Module javafx.base

Interface NumberExpression

    • Method Detail

      • negate

        NumberBinding negate()
        Creates a new NumberBinding that calculates the negation of NumberExpression.
        Returns:
        the new NumberBinding
      • add

        NumberBinding add​(double other)
        Creates a new NumberBinding that calculates the sum of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • add

        NumberBinding add​(float other)
        Creates a new NumberBinding that calculates the sum of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • add

        NumberBinding add​(long other)
        Creates a new NumberBinding that calculates the sum of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • add

        NumberBinding add​(int other)
        Creates a new NumberBinding that calculates the sum of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • subtract

        NumberBinding subtract​(double other)
        Creates a new NumberBinding that calculates the difference of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • subtract

        NumberBinding subtract​(float other)
        Creates a new NumberBinding that calculates the difference of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • subtract

        NumberBinding subtract​(long other)
        Creates a new NumberBinding that calculates the difference of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • subtract

        NumberBinding subtract​(int other)
        Creates a new NumberBinding that calculates the difference of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • multiply

        NumberBinding multiply​(double other)
        Creates a new NumberBinding that calculates the product of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • multiply

        NumberBinding multiply​(float other)
        Creates a new NumberBinding that calculates the product of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • multiply

        NumberBinding multiply​(long other)
        Creates a new NumberBinding that calculates the product of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • multiply

        NumberBinding multiply​(int other)
        Creates a new NumberBinding that calculates the product of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • divide

        NumberBinding divide​(double other)
        Creates a new NumberBinding that calculates the division of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • divide

        NumberBinding divide​(float other)
        Creates a new NumberBinding that calculates the division of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • divide

        NumberBinding divide​(long other)
        Creates a new NumberBinding that calculates the division of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • divide

        NumberBinding divide​(int other)
        Creates a new NumberBinding that calculates the division of this NumberExpression and a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new NumberBinding
      • isEqualTo

        BooleanBinding isEqualTo​(ObservableNumberValue other,
                                 double epsilon)
        Creates a new BooleanBinding that holds true if this and another ObservableNumberValue are equal (with a tolerance).

        Two operands a and b are considered equal if Math.abs(a-b) <= epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers because of rounding-errors.

        Parameters:
        other - the second ObservableNumberValue
        epsilon - the tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the other ObservableNumberValue is null
      • isEqualTo

        BooleanBinding isEqualTo​(double other,
                                 double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is equal to a constant value (with a tolerance).

        Two operands a and b are considered equal if Math.abs(a-b) <= epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers because of rounding-errors.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        BooleanBinding isEqualTo​(float other,
                                 double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is equal to a constant value (with a tolerance).

        Two operands a and b are considered equal if Math.abs(a-b) <= epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers because of rounding-errors.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        BooleanBinding isEqualTo​(long other)
        Creates a new BooleanBinding that holds true if this NumberExpression is equal to a constant value.

        When comparing floating-point numbers it is recommended to use the isEqualTo() method that allows a small tolerance.

        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isEqualTo

        BooleanBinding isEqualTo​(long other,
                                 double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is equal to a constant value (with a tolerance).

        Two operands a and b are considered equal if Math.abs(a-b) <= epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers because of rounding-errors.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        BooleanBinding isEqualTo​(int other)
        Creates a new BooleanBinding that holds true if this NumberExpression is equal to a constant value.

        When comparing floating-point numbers it is recommended to use the isEqualTo() method that allows a small tolerance.

        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isEqualTo

        BooleanBinding isEqualTo​(int other,
                                 double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is equal to a constant value (with a tolerance).

        Two operands a and b are considered equal if Math.abs(a-b) <= epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(ObservableNumberValue other,
                                    double epsilon)
        Creates a new BooleanBinding that holds true if this and another ObservableNumberValue are not equal (with a tolerance).

        Two operands a and b are considered not equal if Math.abs(a-b) > epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers because of rounding-errors.

        Parameters:
        other - the second ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the other ObservableNumberValue is null
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(double other,
                                    double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is not equal to a constant value (with a tolerance).

        Two operands a and b are considered not equal if Math.abs(a-b) > epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(float other,
                                    double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is not equal to a constant value (with a tolerance).

        Two operands a and b are considered not equal if Math.abs(a-b) > epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(long other)
        Creates a new BooleanBinding that holds true if this NumberExpression is not equal to a constant value.

        When comparing floating-point numbers it is recommended to use the isNotEqualTo() method that allows a small tolerance.

        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(long other,
                                    double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is not equal to a constant value (with a tolerance).

        Two operands a and b are considered not equal if Math.abs(a-b) > epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(int other)
        Creates a new BooleanBinding that holds true if this NumberExpression is not equal to a constant value.

        When comparing floating-point numbers it is recommended to use the isNotEqualTo() method that allows a small tolerance.

        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        BooleanBinding isNotEqualTo​(int other,
                                    double epsilon)
        Creates a new BooleanBinding that holds true if this NumberExpression is not equal to a constant value (with a tolerance).

        Two operands a and b are considered not equal if Math.abs(a-b) > epsilon.

        Allowing a small tolerance is recommended when comparing floating-point numbers.

        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • greaterThan

        BooleanBinding greaterThan​(double other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThan

        BooleanBinding greaterThan​(float other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThan

        BooleanBinding greaterThan​(long other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThan

        BooleanBinding greaterThan​(int other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        BooleanBinding lessThan​(double other)
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        BooleanBinding lessThan​(float other)
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        BooleanBinding lessThan​(long other)
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        BooleanBinding lessThan​(int other)
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThanOrEqualTo

        BooleanBinding greaterThanOrEqualTo​(double other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThanOrEqualTo

        BooleanBinding greaterThanOrEqualTo​(float other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThanOrEqualTo

        BooleanBinding greaterThanOrEqualTo​(long other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • greaterThanOrEqualTo

        BooleanBinding greaterThanOrEqualTo​(int other)
        Creates a new BooleanBinding that holds true if this NumberExpression is greater than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThanOrEqualTo

        BooleanBinding lessThanOrEqualTo​(double other)
        Creates a new BooleanBinding that holds true if this NumberExpression is less than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThanOrEqualTo

        BooleanBinding lessThanOrEqualTo​(float other)
        Creates a new BooleanBinding that holds true if this NumberExpression is less than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThanOrEqualTo

        BooleanBinding lessThanOrEqualTo​(long other)
        Creates a new BooleanBinding that holds true if this NumberExpression is less than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThanOrEqualTo

        BooleanBinding lessThanOrEqualTo​(int other)
        Creates a new BooleanBinding that holds true if this NumberExpression is less than or equal to a constant value.
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • asString

        StringBinding asString()
        Creates a StringBinding that holds the value of the NumberExpression turned into a String. If the value of this NumberExpression changes, the value of the StringBinding will be updated automatically.

        The conversion is done without any formatting applied.

        Returns:
        the new StringBinding
      • asString

        StringBinding asString​(String format)
        Creates a StringBinding that holds the value of the NumberExpression turned into a String. If the value of this NumberExpression changes, the value of the StringBinding will be updated automatically.

        The result is formatted according to the formatting String. See java.util.Formatter for formatting rules.

        Parameters:
        format - the formatting String
        Returns:
        the new StringBinding
      • asString

        StringBinding asString​(Locale locale,
                               String format)
        Creates a StringBinding that holds the value of the NumberExpression turned into a String. If the value of this NumberExpression changes, the value of the StringBinding will be updated automatically.

        The result is formatted according to the formatting String and the passed in Locale. See java.util.Formatter for formatting rules. See java.util.Locale for details on Locale.

        Parameters:
        locale - the Locale to be used
        format - the formatting String
        Returns:
        the new StringBinding