1 /*
   2  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.beans.binding;
  27 
  28 import java.util.Locale;
  29 
  30 import javafx.beans.value.ObservableNumberValue;
  31 
  32 /**
  33  * {@code NumberExpression} is an
  34  * {@link javafx.beans.value.ObservableNumberValue} plus additional convenience
  35  * methods to generate bindings in a fluent style.
  36  * <p>
  37  * This API allows to mix types when defining arithmetic operations. The type of
  38  * the result is defined by the same rules as in the Java Language.
  39  * <ol>
  40  * <li>If one of the operands is a double, the result is a double.</li>
  41  * <li>If not and one of the operands is a float, the result is a float.</li>
  42  * <li>If not and one of the operands is a long, the result is a long.</li>
  43  * <li>The result is an integer otherwise.</li>
  44  * </ol>
  45  * <p>
  46  * To be able to deal with an unspecified return type, two interfaces
  47  * {@code NumberExpression} and its counterpart
  48  * {@link javafx.beans.binding.NumberBinding} were introduced. That means if the
  49  * return type is specified as {@code NumberBinding}, the method will either
  50  * return a {@link javafx.beans.binding.DoubleBinding},
  51  * {@link javafx.beans.binding.FloatBinding},
  52  * {@link javafx.beans.binding.LongBinding} or
  53  * {@link javafx.beans.binding.IntegerBinding}, depending on the types of the
  54  * operands.
  55  * <p>
  56  * The API tries to do its best in determining the correct return type, e.g.
  57  * combining a {@link javafx.beans.value.ObservableNumberValue} with a primitive
  58  * double will always result in a {@link javafx.beans.binding.DoubleBinding}. In
  59  * cases where the return type is not known by the API, it is the responsibility
  60  * of the developer to call the correct getter ({@link #intValue()} etc.). If
  61  * the internal representation does not match the type of the getter, a standard
  62  * cast is done.
  63  * @since JavaFX 2.0
  64  */
  65 public interface NumberExpression extends ObservableNumberValue {
  66 
  67     // ===============================================================
  68     // Negation
  69 
  70     /**
  71      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
  72      * the negation of {@code NumberExpression}.
  73      *
  74      * @return the new {@code NumberBinding}
  75      */
  76     NumberBinding negate();
  77 
  78     // ===============================================================
  79     // Plus
  80 
  81     /**
  82      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
  83      * the sum of this {@code NumberExpression} and another
  84      * {@link javafx.beans.value.ObservableNumberValue}.
  85      *
  86      * @param other
  87      *            the second {@code ObservableNumberValue}
  88      * @return the new {@code NumberBinding}
  89      * @throws NullPointerException
  90      *             if the other {@code ObservableNumberValue} is {@code null}
  91      */
  92     NumberBinding add(final ObservableNumberValue other);
  93 
  94     /**
  95      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
  96      * the sum of this {@code NumberExpression} and a constant value.
  97      *
  98      * @param other
  99      *            the constant value
 100      * @return the new {@code NumberBinding}
 101      */
 102     NumberBinding add(final double other);
 103 
 104     /**
 105      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 106      * the sum of this {@code NumberExpression} and a constant value.
 107      *
 108      * @param other
 109      *            the constant value
 110      * @return the new {@code NumberBinding}
 111      */
 112     NumberBinding add(final float other);
 113 
 114     /**
 115      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 116      * the sum of this {@code NumberExpression} and a constant value.
 117      *
 118      * @param other
 119      *            the constant value
 120      * @return the new {@code NumberBinding}
 121      */
 122     NumberBinding add(final long other);
 123 
 124     /**
 125      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 126      * the sum of this {@code NumberExpression} and a constant value.
 127      *
 128      * @param other
 129      *            the constant value
 130      * @return the new {@code NumberBinding}
 131      */
 132     NumberBinding add(final int other);
 133 
 134     // ===============================================================
 135     // Minus
 136 
 137     /**
 138      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 139      * the difference of this {@code NumberExpression} and another
 140      * {@link javafx.beans.value.ObservableNumberValue}.
 141      *
 142      * @param other
 143      *            the second {@code ObservableNumberValue}
 144      * @return the new {@code NumberBinding}
 145      * @throws NullPointerException
 146      *             if the other {@code ObservableNumberValue} is {@code null}
 147      */
 148     NumberBinding subtract(final ObservableNumberValue other);
 149 
 150     /**
 151      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 152      * the difference of this {@code NumberExpression} and a constant value.
 153      *
 154      * @param other
 155      *            the constant value
 156      * @return the new {@code NumberBinding}
 157      */
 158     NumberBinding subtract(final double other);
 159 
 160     /**
 161      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 162      * the difference of this {@code NumberExpression} and a constant value.
 163      *
 164      * @param other
 165      *            the constant value
 166      * @return the new {@code NumberBinding}
 167      */
 168     NumberBinding subtract(final float other);
 169 
 170     /**
 171      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 172      * the difference of this {@code NumberExpression} and a constant value.
 173      *
 174      * @param other
 175      *            the constant value
 176      * @return the new {@code NumberBinding}
 177      */
 178     NumberBinding subtract(final long other);
 179 
 180     /**
 181      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 182      * the difference of this {@code NumberExpression} and a constant value.
 183      *
 184      * @param other
 185      *            the constant value
 186      * @return the new {@code NumberBinding}
 187      */
 188     NumberBinding subtract(final int other);
 189 
 190     // ===============================================================
 191     // Times
 192 
 193     /**
 194      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 195      * the product of this {@code NumberExpression} and another
 196      * {@link javafx.beans.value.ObservableNumberValue}.
 197      *
 198      * @param other
 199      *            the second {@code ObservableNumberValue}
 200      * @return the new {@code NumberBinding}
 201      * @throws NullPointerException
 202      *             if the other {@code ObservableNumberValue} is {@code null}
 203      */
 204     NumberBinding multiply(final ObservableNumberValue other);
 205 
 206     /**
 207      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 208      * the product of this {@code NumberExpression} and a constant value.
 209      *
 210      * @param other
 211      *            the constant value
 212      * @return the new {@code NumberBinding}
 213      */
 214     NumberBinding multiply(final double other);
 215 
 216     /**
 217      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 218      * the product of this {@code NumberExpression} and a constant value.
 219      *
 220      * @param other
 221      *            the constant value
 222      * @return the new {@code NumberBinding}
 223      */
 224     NumberBinding multiply(final float other);
 225 
 226     /**
 227      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 228      * the product of this {@code NumberExpression} and a constant value.
 229      *
 230      * @param other
 231      *            the constant value
 232      * @return the new {@code NumberBinding}
 233      */
 234     NumberBinding multiply(final long other);
 235 
 236     /**
 237      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 238      * the product of this {@code NumberExpression} and a constant value.
 239      *
 240      * @param other
 241      *            the constant value
 242      * @return the new {@code NumberBinding}
 243      */
 244     NumberBinding multiply(final int other);
 245 
 246     // ===============================================================
 247     // DividedBy
 248 
 249     /**
 250      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 251      * the division of this {@code NumberExpression} and another
 252      * {@link javafx.beans.value.ObservableNumberValue}.
 253      *
 254      * @param other
 255      *            the second {@code ObservableNumberValue}
 256      * @return the new {@code NumberBinding}
 257      * @throws NullPointerException
 258      *             if the other {@code ObservableNumberValue} is {@code null}
 259      */
 260     NumberBinding divide(final ObservableNumberValue other);
 261 
 262     /**
 263      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 264      * the division of this {@code NumberExpression} and a constant value.
 265      *
 266      * @param other
 267      *            the constant value
 268      * @return the new {@code NumberBinding}
 269      */
 270     NumberBinding divide(final double other);
 271 
 272     /**
 273      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 274      * the division of this {@code NumberExpression} and a constant value.
 275      *
 276      * @param other
 277      *            the constant value
 278      * @return the new {@code NumberBinding}
 279      */
 280     NumberBinding divide(final float other);
 281 
 282     /**
 283      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 284      * the division of this {@code NumberExpression} and a constant value.
 285      *
 286      * @param other
 287      *            the constant value
 288      * @return the new {@code NumberBinding}
 289      */
 290     NumberBinding divide(final long other);
 291 
 292     /**
 293      * Creates a new {@link javafx.beans.binding.NumberBinding} that calculates
 294      * the division of this {@code NumberExpression} and a constant value.
 295      *
 296      * @param other
 297      *            the constant value
 298      * @return the new {@code NumberBinding}
 299      */
 300     NumberBinding divide(final int other);
 301 
 302     // ===============================================================
 303     // IsEqualTo
 304 
 305     /**
 306      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 307      * if this and another {@link javafx.beans.value.ObservableNumberValue} are
 308      * equal.
 309      * <p>
 310      * When comparing floating-point numbers it is recommended to use the
 311      * {@link #isEqualTo(ObservableNumberValue, double) isEqualTo()} method that
 312      * allows a small tolerance.
 313      *
 314      * @param other
 315      *            the second {@code ObservableNumberValue}
 316      * @return the new {@code BooleanBinding}
 317      * @throws NullPointerException
 318      *             if the other {@code ObservableNumberValue} is {@code null}
 319      */
 320     BooleanBinding isEqualTo(final ObservableNumberValue other);
 321 
 322     /**
 323      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 324      * if this and another {@link javafx.beans.value.ObservableNumberValue} are
 325      * equal (with a tolerance).
 326      * <p>
 327      * Two operands {@code a} and {@code b} are considered equal if
 328      * {@code Math.abs(a-b) <= epsilon}.
 329      * <p>
 330      * Allowing a small tolerance is recommended when comparing floating-point
 331      * numbers because of rounding-errors.
 332      *
 333      * @param other
 334      *            the second {@code ObservableNumberValue}
 335      * @param epsilon
 336      *            the tolerance
 337      * @return the new {@code BooleanBinding}
 338      * @throws NullPointerException
 339      *             if the other {@code ObservableNumberValue} is {@code null}
 340      */
 341     BooleanBinding isEqualTo(final ObservableNumberValue other, double epsilon);
 342 
 343     /**
 344      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 345      * if this {@code NumberExpression} is equal to a constant value (with a
 346      * tolerance).
 347      * <p>
 348      * Two operands {@code a} and {@code b} are considered equal if
 349      * {@code Math.abs(a-b) <= epsilon}.
 350      * <p>
 351      * Allowing a small tolerance is recommended when comparing floating-point
 352      * numbers because of rounding-errors.
 353      *
 354      * @param other
 355      *            the constant value
 356      * @param epsilon
 357      *            the permitted tolerance
 358      * @return the new {@code BooleanBinding}
 359      */
 360     BooleanBinding isEqualTo(final double other, double epsilon);
 361 
 362     /**
 363      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 364      * if this {@code NumberExpression} is equal to a constant value (with a
 365      * tolerance).
 366      * <p>
 367      * Two operands {@code a} and {@code b} are considered equal if
 368      * {@code Math.abs(a-b) <= epsilon}.
 369      * <p>
 370      * Allowing a small tolerance is recommended when comparing floating-point
 371      * numbers because of rounding-errors.
 372      *
 373      * @param other
 374      *            the constant value
 375      * @param epsilon
 376      *            the permitted tolerance
 377      * @return the new {@code BooleanBinding}
 378      */
 379     BooleanBinding isEqualTo(final float other, double epsilon);
 380 
 381     /**
 382      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 383      * if this {@code NumberExpression} is equal to a constant value.
 384      * <p>
 385      * When comparing floating-point numbers it is recommended to use the
 386      * {@link #isEqualTo(long, double) isEqualTo()} method that allows a small
 387      * tolerance.
 388      *
 389      * @param other
 390      *            the constant value
 391      * @return the new {@code BooleanBinding}
 392      */
 393     BooleanBinding isEqualTo(final long other);
 394 
 395     /**
 396      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 397      * if this {@code NumberExpression} is equal to a constant value (with a
 398      * tolerance).
 399      * <p>
 400      * Two operands {@code a} and {@code b} are considered equal if
 401      * {@code Math.abs(a-b) <= epsilon}.
 402      * <p>
 403      * Allowing a small tolerance is recommended when comparing floating-point
 404      * numbers because of rounding-errors.
 405      *
 406      * @param other
 407      *            the constant value
 408      * @param epsilon
 409      *            the permitted tolerance
 410      * @return the new {@code BooleanBinding}
 411      */
 412     BooleanBinding isEqualTo(final long other, double epsilon);
 413 
 414     /**
 415      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 416      * if this {@code NumberExpression} is equal to a constant value.
 417      * <p>
 418      * When comparing floating-point numbers it is recommended to use the
 419      * {@link #isEqualTo(int, double) isEqualTo()} method that allows a small
 420      * tolerance.
 421      *
 422      * @param other
 423      *            the constant value
 424      * @return the new {@code BooleanBinding}
 425      */
 426     BooleanBinding isEqualTo(final int other);
 427 
 428     /**
 429      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 430      * if this {@code NumberExpression} is equal to a constant value (with a
 431      * tolerance).
 432      * <p>
 433      * Two operands {@code a} and {@code b} are considered equal if
 434      * {@code Math.abs(a-b) <= epsilon}.
 435      * <p>
 436      * Allowing a small tolerance is recommended when comparing floating-point
 437      * numbers.
 438      *
 439      * @param other
 440      *            the constant value
 441      * @param epsilon
 442      *            the permitted tolerance
 443      * @return the new {@code BooleanBinding}
 444      */
 445     BooleanBinding isEqualTo(final int other, double epsilon);
 446 
 447     // ===============================================================
 448     // IsNotEqualTo
 449 
 450     /**
 451      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 452      * if this and another {@link javafx.beans.value.ObservableNumberValue} are
 453      * not equal.
 454      * <p>
 455      * When comparing floating-point numbers it is recommended to use the
 456      * {@link #isNotEqualTo(ObservableNumberValue, double) isNotEqualTo()}
 457      * method that allows a small tolerance.
 458      *
 459      * @param other
 460      *            the second {@code ObservableNumberValue}
 461      * @return the new {@code BooleanBinding}
 462      * @throws NullPointerException
 463      *             if the other {@code ObservableNumberValue} is {@code null}
 464      */
 465     BooleanBinding isNotEqualTo(final ObservableNumberValue other);
 466 
 467     /**
 468      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 469      * if this and another {@link javafx.beans.value.ObservableNumberValue} are
 470      * not equal (with a tolerance).
 471      * <p>
 472      * Two operands {@code a} and {@code b} are considered not equal if
 473      * {@code Math.abs(a-b) > epsilon}.
 474      * <p>
 475      * Allowing a small tolerance is recommended when comparing floating-point
 476      * numbers because of rounding-errors.
 477      *
 478      * @param other
 479      *            the second {@code ObservableNumberValue}
 480      * @param epsilon
 481      *            the permitted tolerance
 482      * @return the new {@code BooleanBinding}
 483      * @throws NullPointerException
 484      *             if the other {@code ObservableNumberValue} is {@code null}
 485      */
 486     BooleanBinding isNotEqualTo(final ObservableNumberValue other,
 487             double epsilon);
 488 
 489     /**
 490      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 491      * if this {@code NumberExpression} is not equal to a constant value (with a
 492      * tolerance).
 493      * <p>
 494      * Two operands {@code a} and {@code b} are considered not equal if
 495      * {@code Math.abs(a-b) > epsilon}.
 496      * <p>
 497      * Allowing a small tolerance is recommended when comparing floating-point
 498      * numbers.
 499      *
 500      * @param other
 501      *            the constant value
 502      * @param epsilon
 503      *            the permitted tolerance
 504      * @return the new {@code BooleanBinding}
 505      */
 506     BooleanBinding isNotEqualTo(final double other, double epsilon);
 507 
 508     /**
 509      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 510      * if this {@code NumberExpression} is not equal to a constant value (with a
 511      * tolerance).
 512      * <p>
 513      * Two operands {@code a} and {@code b} are considered not equal if
 514      * {@code Math.abs(a-b) > epsilon}.
 515      * <p>
 516      * Allowing a small tolerance is recommended when comparing floating-point
 517      * numbers.
 518      *
 519      * @param other
 520      *            the constant value
 521      * @param epsilon
 522      *            the permitted tolerance
 523      * @return the new {@code BooleanBinding}
 524      */
 525     BooleanBinding isNotEqualTo(final float other, double epsilon);
 526 
 527     /**
 528      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 529      * if this {@code NumberExpression} is not equal to a constant value.
 530      * <p>
 531      * When comparing floating-point numbers it is recommended to use the
 532      * {@link #isNotEqualTo(long, double) isNotEqualTo()} method that allows a
 533      * small tolerance.
 534      *
 535      * @param other
 536      *            the constant value
 537      * @return the new {@code BooleanBinding}
 538      */
 539     BooleanBinding isNotEqualTo(final long other);
 540 
 541     /**
 542      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 543      * if this {@code NumberExpression} is not equal to a constant value (with a
 544      * tolerance).
 545      * <p>
 546      * Two operands {@code a} and {@code b} are considered not equal if
 547      * {@code Math.abs(a-b) > epsilon}.
 548      * <p>
 549      * Allowing a small tolerance is recommended when comparing floating-point
 550      * numbers.
 551      *
 552      * @param other
 553      *            the constant value
 554      * @param epsilon
 555      *            the permitted tolerance
 556      * @return the new {@code BooleanBinding}
 557      */
 558     BooleanBinding isNotEqualTo(final long other, double epsilon);
 559 
 560     /**
 561      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 562      * if this {@code NumberExpression} is not equal to a constant value.
 563      * <p>
 564      * When comparing floating-point numbers it is recommended to use the
 565      * {@link #isNotEqualTo(int, double) isNotEqualTo()} method that allows a
 566      * small tolerance.
 567      *
 568      * @param other
 569      *            the constant value
 570      * @return the new {@code BooleanBinding}
 571      */
 572     BooleanBinding isNotEqualTo(final int other);
 573 
 574     /**
 575      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 576      * if this {@code NumberExpression} is not equal to a constant value (with a
 577      * tolerance).
 578      * <p>
 579      * Two operands {@code a} and {@code b} are considered not equal if
 580      * {@code Math.abs(a-b) > epsilon}.
 581      * <p>
 582      * Allowing a small tolerance is recommended when comparing floating-point
 583      * numbers.
 584      *
 585      * @param other
 586      *            the constant value
 587      * @param epsilon
 588      *            the permitted tolerance
 589      * @return the new {@code BooleanBinding}
 590      */
 591     BooleanBinding isNotEqualTo(final int other, double epsilon);
 592 
 593     // ===============================================================
 594     // IsGreaterThan
 595 
 596     /**
 597      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 598      * if this {@code NumberExpression} is greater than another
 599      * {@link javafx.beans.value.ObservableNumberValue}.
 600      *
 601      * @param other
 602      *            the second {@code ObservableNumberValue}
 603      * @return the new {@code BooleanBinding}
 604      * @throws NullPointerException
 605      *             if the other {@code ObservableNumberValue} is {@code null}
 606      */
 607     BooleanBinding greaterThan(final ObservableNumberValue other);
 608 
 609     /**
 610      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 611      * if this {@code NumberExpression} is greater than a constant value.
 612      *
 613      * @param other
 614      *            the constant value
 615      * @return the new {@code BooleanBinding}
 616      */
 617     BooleanBinding greaterThan(final double other);
 618 
 619     /**
 620      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 621      * if this {@code NumberExpression} is greater than a constant value.
 622      *
 623      * @param other
 624      *            the constant value
 625      * @return the new {@code BooleanBinding}
 626      */
 627     BooleanBinding greaterThan(final float other);
 628 
 629     /**
 630      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 631      * if this {@code NumberExpression} is greater than a constant value.
 632      *
 633      * @param other
 634      *            the constant value
 635      * @return the new {@code BooleanBinding}
 636      */
 637     BooleanBinding greaterThan(final long other);
 638 
 639     /**
 640      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 641      * if this {@code NumberExpression} is greater than a constant value.
 642      *
 643      * @param other
 644      *            the constant value
 645      * @return the new {@code BooleanBinding}
 646      */
 647     BooleanBinding greaterThan(final int other);
 648 
 649     // ===============================================================
 650     // IsLesserThan
 651 
 652     /**
 653      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 654      * if this {@code NumberExpression} is lesser than another
 655      * {@link javafx.beans.value.ObservableNumberValue}.
 656      *
 657      * @param other
 658      *            the second {@code ObservableNumberValue}
 659      * @return the new {@code BooleanBinding}
 660      * @throws NullPointerException
 661      *             if the other {@code ObservableNumberValue} is {@code null}
 662      */
 663     BooleanBinding lessThan(final ObservableNumberValue other);
 664 
 665     /**
 666      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 667      * if this {@code NumberExpression} is lesser than a constant value.
 668      *
 669      * @param other
 670      *            the constant value
 671      * @return the new {@code BooleanBinding}
 672      */
 673     BooleanBinding lessThan(final double other);
 674 
 675     /**
 676      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 677      * if this {@code NumberExpression} is lesser than a constant value.
 678      *
 679      * @param other
 680      *            the constant value
 681      * @return the new {@code BooleanBinding}
 682      */
 683     BooleanBinding lessThan(final float other);
 684 
 685     /**
 686      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 687      * if this {@code NumberExpression} is lesser than a constant value.
 688      *
 689      * @param other
 690      *            the constant value
 691      * @return the new {@code BooleanBinding}
 692      */
 693     BooleanBinding lessThan(final long other);
 694 
 695     /**
 696      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 697      * if this {@code NumberExpression} is lesser than a constant value.
 698      *
 699      * @param other
 700      *            the constant value
 701      * @return the new {@code BooleanBinding}
 702      */
 703     BooleanBinding lessThan(final int other);
 704 
 705     // ===============================================================
 706     // IsGreaterThanOrEqualTo
 707 
 708     /**
 709      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 710      * if this {@code NumberExpression} is greater than or equal to another
 711      * {@link javafx.beans.value.ObservableNumberValue}.
 712      *
 713      * @param other
 714      *            the second {@code ObservableNumberValue}
 715      * @return the new {@code BooleanBinding}
 716      * @throws NullPointerException
 717      *             if the other {@code ObservableNumberValue} is {@code null}
 718      */
 719     BooleanBinding greaterThanOrEqualTo(final ObservableNumberValue other);
 720 
 721     /**
 722      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 723      * if this {@code NumberExpression} is greater than or equal to a constant
 724      * value.
 725      *
 726      * @param other
 727      *            the constant value
 728      * @return the new {@code BooleanBinding}
 729      */
 730     BooleanBinding greaterThanOrEqualTo(final double other);
 731 
 732     /**
 733      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 734      * if this {@code NumberExpression} is greater than or equal to a constant
 735      * value.
 736      *
 737      * @param other
 738      *            the constant value
 739      * @return the new {@code BooleanBinding}
 740      */
 741     BooleanBinding greaterThanOrEqualTo(final float other);
 742 
 743     /**
 744      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 745      * if this {@code NumberExpression} is greater than or equal to a constant
 746      * value.
 747      *
 748      * @param other
 749      *            the constant value
 750      * @return the new {@code BooleanBinding}
 751      */
 752     BooleanBinding greaterThanOrEqualTo(final long other);
 753 
 754     /**
 755      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 756      * if this {@code NumberExpression} is greater than or equal to a constant
 757      * value.
 758      *
 759      * @param other
 760      *            the constant value
 761      * @return the new {@code BooleanBinding}
 762      */
 763     BooleanBinding greaterThanOrEqualTo(final int other);
 764 
 765     // ===============================================================
 766     // IsLessThanOrEqualTo
 767 
 768     /**
 769      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 770      * if this {@code NumberExpression} is less than or equal to another
 771      * {@link javafx.beans.value.ObservableNumberValue}.
 772      *
 773      * @param other
 774      *            the second {@code ObservableNumberValue}
 775      * @return the new {@code BooleanBinding}
 776      * @throws NullPointerException
 777      *             if the other {@code ObservableNumberValue} is {@code null}
 778      */
 779     BooleanBinding lessThanOrEqualTo(final ObservableNumberValue other);
 780 
 781     /**
 782      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 783      * if this {@code NumberExpression} is less than or equal to a constant
 784      * value.
 785      *
 786      * @param other
 787      *            the constant value
 788      * @return the new {@code BooleanBinding}
 789      */
 790     BooleanBinding lessThanOrEqualTo(final double other);
 791 
 792     /**
 793      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 794      * if this {@code NumberExpression} is less than or equal to a constant
 795      * value.
 796      *
 797      * @param other
 798      *            the constant value
 799      * @return the new {@code BooleanBinding}
 800      */
 801     BooleanBinding lessThanOrEqualTo(final float other);
 802 
 803     /**
 804      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 805      * if this {@code NumberExpression} is less than or equal to a constant
 806      * value.
 807      *
 808      * @param other
 809      *            the constant value
 810      * @return the new {@code BooleanBinding}
 811      */
 812     BooleanBinding lessThanOrEqualTo(final long other);
 813 
 814     /**
 815      * Creates a new {@link javafx.beans.binding.BooleanBinding} that holds {@code true}
 816      * if this {@code NumberExpression} is less than or equal to a constant
 817      * value.
 818      *
 819      * @param other
 820      *            the constant value
 821      * @return the new {@code BooleanBinding}
 822      */
 823     BooleanBinding lessThanOrEqualTo(final int other);
 824 
 825     // ===============================================================
 826     // String conversions
 827 
 828     /**
 829      * Creates a {@link javafx.beans.binding.StringBinding} that holds the value
 830      * of the {@code NumberExpression} turned into a {@code String}. If the
 831      * value of this {@code NumberExpression} changes, the value of the
 832      * {@code StringBinding} will be updated automatically.
 833      * <p>
 834      * The conversion is done without any formatting applied.
 835      *
 836      * @return the new {@code StringBinding}
 837      */
 838     StringBinding asString();
 839 
 840     /**
 841      * Creates a {@link javafx.beans.binding.StringBinding} that holds the value
 842      * of the {@code NumberExpression} turned into a {@code String}. If the
 843      * value of this {@code NumberExpression} changes, the value of the
 844      * {@code StringBinding} will be updated automatically.
 845      * <p>
 846      * The result is formatted according to the formatting {@code String}. See
 847      * {@code java.util.Formatter} for formatting rules.
 848      *
 849      * @param format
 850      *            the formatting {@code String}
 851      * @return the new {@code StringBinding}
 852      */
 853     StringBinding asString(String format);
 854 
 855     /**
 856      * Creates a {@link javafx.beans.binding.StringBinding} that holds the value
 857      * of the {@code NumberExpression} turned into a {@code String}. If the
 858      * value of this {@code NumberExpression} changes, the value of the
 859      * {@code StringBinding} will be updated automatically.
 860      * <p>
 861      * The result is formatted according to the formatting {@code String} and
 862      * the passed in {@code Locale}. See {@code java.util.Formatter} for
 863      * formatting rules. See {@code java.util.Locale} for details on
 864      * {@code Locale}.
 865      *
 866      * @param locale the Locale to be used
 867      * @param format
 868      *            the formatting {@code String}
 869      * @return the new {@code StringBinding}
 870      */
 871     StringBinding asString(Locale locale, String format);
 872 }