Module javafx.base

Class NumberExpressionBase

    • Constructor Detail

      • NumberExpressionBase

        public NumberExpressionBase​()
    • Method Detail

      • numberExpression

        public static <S extends NumberNumberExpressionBase numberExpression​(ObservableNumberValue value)
        Returns an NumberExpressionBase that wraps a ObservableNumberValue. If the ObservableNumberValue is already an instance of NumberExpressionBase, it will be returned. Otherwise a new NumberBinding is created that is bound to the ObservableNumberValue.
        Type Parameters:
        S - The type of Number to be wrapped
        Parameters:
        value - The source ObservableNumberValue
        Returns:
        An NumberExpressionBase that wraps the ObservableNumberValue if necessary
        Throws:
        NullPointerException - if value is null
      • isEqualTo

        public BooleanBinding isEqualTo​(ObservableNumberValue other,
                                        double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the second ObservableNumberValue
        epsilon - the tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        public BooleanBinding isEqualTo​(double other,
                                        double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        public BooleanBinding isEqualTo​(float other,
                                        double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        public BooleanBinding isEqualTo​(long other)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isEqualTo

        public BooleanBinding isEqualTo​(long other,
                                        double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isEqualTo

        public BooleanBinding isEqualTo​(int other)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isEqualTo

        public BooleanBinding isEqualTo​(int other,
                                        double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(ObservableNumberValue other,
                                           double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the second ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(double other,
                                           double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(float other,
                                           double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(long other)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(long other,
                                           double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(int other)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • isNotEqualTo

        public BooleanBinding isNotEqualTo​(int other,
                                           double epsilon)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        isNotEqualTo in interface NumberExpression
        Parameters:
        other - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
      • lessThan

        public BooleanBinding lessThan​(double other)
        Description copied from interface: NumberExpression
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Specified by:
        lessThan in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        public BooleanBinding lessThan​(float other)
        Description copied from interface: NumberExpression
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Specified by:
        lessThan in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        public BooleanBinding lessThan​(long other)
        Description copied from interface: NumberExpression
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Specified by:
        lessThan in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • lessThan

        public BooleanBinding lessThan​(int other)
        Description copied from interface: NumberExpression
        Creates a new BooleanBinding that holds true if this NumberExpression is lesser than a constant value.
        Specified by:
        lessThan in interface NumberExpression
        Parameters:
        other - the constant value
        Returns:
        the new BooleanBinding
      • asString

        public StringBinding asString​()
        Description copied from interface: NumberExpression
        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.

        Specified by:
        asString in interface NumberExpression
        Returns:
        the new StringBinding
      • asString

        public StringBinding asString​(String format)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        asString in interface NumberExpression
        Parameters:
        format - the formatting String
        Returns:
        the new StringBinding
      • asString

        public StringBinding asString​(Locale locale,
                                      String format)
        Description copied from interface: NumberExpression
        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.

        Specified by:
        asString in interface NumberExpression
        Parameters:
        locale - the Locale to be used
        format - the formatting String
        Returns:
        the new StringBinding