Module javafx.base

Class Bindings



  • public final class Bindings
    extends Object
    Bindings is a helper class with a lot of utility functions to create simple bindings.

    Usually there are two possibilities to define the same operation: the Fluent API and the the factory methods in this class. This allows a developer to define complex expression in a way that is most easy to understand. For instance the expression result = a*b + c*d can be defined using only the Fluent API:

    DoubleBinding result = a.multiply(b).add(c.multiply(d));

    Or using only factory methods in Bindings:

    NumberBinding result = add (multiply(a, b), multiply(c,d));

    Or mixing both possibilities:

    NumberBinding result = add (a.multiply(b), c.multiply(d));

    The main difference between using the Fluent API and using the factory methods in this class is that the Fluent API requires that at least one of the operands is an Expression (see javafx.beans.binding). (Every Expression contains a static method that generates an Expression from an ObservableValue.)

    Also if you watched closely, you might have noticed that the return type of the Fluent API is different in the examples above. In a lot of cases the Fluent API allows to be more specific about the returned type (see NumberExpression for more details about implicit casting.

    Deploying an Application as a Module

    If any class used in a select-binding (see the various select* methods) is in a named module, then it must be reflectively accessible to the javafx.base module. A class is reflectively accessible if the module opens the containing package to at least the javafx.base module.

    For example, if com.foo.MyClass is in the foo.app module, the module-info.java might look like this:

    module foo.app {
        opens com.foo to javafx.base;
    }

    Alternatively, a class is reflectively accessible if the module exports the containing package unconditionally.

    Since:
    JavaFX 2.0
    See Also:
    Binding, NumberBinding
    • Method Detail

      • createBooleanBinding

        public static BooleanBinding createBooleanBinding​(Callable<Boolean> func,
                                                          Observable... dependencies)
        Helper function to create a custom BooleanBinding.
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • createDoubleBinding

        public static DoubleBinding createDoubleBinding​(Callable<Double> func,
                                                        Observable... dependencies)
        Helper function to create a custom DoubleBinding.
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • createFloatBinding

        public static FloatBinding createFloatBinding​(Callable<Float> func,
                                                      Observable... dependencies)
        Helper function to create a custom FloatBinding.
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • createIntegerBinding

        public static IntegerBinding createIntegerBinding​(Callable<Integer> func,
                                                          Observable... dependencies)
        Helper function to create a custom IntegerBinding.
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • createLongBinding

        public static LongBinding createLongBinding​(Callable<Long> func,
                                                    Observable... dependencies)
        Helper function to create a custom LongBinding.
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • createObjectBinding

        public static <T> ObjectBinding<T> createObjectBinding​(Callable<T> func,
                                                               Observable... dependencies)
        Helper function to create a custom ObjectBinding.
        Type Parameters:
        T - the type of the bound Object
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • createStringBinding

        public static StringBinding createStringBinding​(Callable<String> func,
                                                        Observable... dependencies)
        Helper function to create a custom StringBinding.
        Parameters:
        func - The function that calculates the value of this binding
        dependencies - The dependencies of this binding
        Returns:
        The generated binding
        Since:
        JavaFX 2.1
      • select

        public static <T> ObjectBinding<T> select​(ObservableValue<?> root,
                                                  String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or null if c could not be reached (due to b not having a c property, b being null, or c not being the right type etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Type Parameters:
        T - the type of the wrapped Object
        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created ObjectBinding
      • selectDouble

        public static DoubleBinding selectDouble​(ObservableValue<?> root,
                                                 String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0.0 if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created DoubleBinding
      • selectFloat

        public static FloatBinding selectFloat​(ObservableValue<?> root,
                                               String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0.0f if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created FloatBinding
      • selectInteger

        public static IntegerBinding selectInteger​(ObservableValue<?> root,
                                                   String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0 if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created IntegerBinding
      • selectLong

        public static LongBinding selectLong​(ObservableValue<?> root,
                                             String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0L if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created LongBinding
      • selectBoolean

        public static BooleanBinding selectBoolean​(ObservableValue<?> root,
                                                   String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or false if c could not be reached (due to b not having a c property, b being null, or c not being a boolean etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created ObjectBinding
      • selectString

        public static StringBinding selectString​(ObservableValue<?> root,
                                                 String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or "" if c could not be reached (due to b not having a c property, b being null, or c not being a String etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        Note: since 8.0, JavaBeans properties are supported and might be in the chain.

        Parameters:
        root - The root ObservableValue
        steps - The property names to reach the final property
        Returns:
        the created ObjectBinding
      • select

        public static <T> ObjectBinding<T> select​(Object root,
                                                  String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or null if c could not be reached (due to b not having a c property, b being null, or c not being the right type etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to select(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Type Parameters:
        T - the type of the wrapped Object
        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created ObjectBinding
        Since:
        JavaFX 8.0
      • selectDouble

        public static DoubleBinding selectDouble​(Object root,
                                                 String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0.0 if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to selectDouble(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created DoubleBinding
        Since:
        JavaFX 8.0
      • selectFloat

        public static FloatBinding selectFloat​(Object root,
                                               String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0.0f if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to selectFloat(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created FloatBinding
        Since:
        JavaFX 8.0
      • selectInteger

        public static IntegerBinding selectInteger​(Object root,
                                                   String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0 if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to selectInteger(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created IntegerBinding
        Since:
        JavaFX 8.0
      • selectLong

        public static LongBinding selectLong​(Object root,
                                             String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or 0L if c could not be reached (due to b not having a c property, b being null, or c not being a Number etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to selectLong(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created LongBinding
        Since:
        JavaFX 8.0
      • selectBoolean

        public static BooleanBinding selectBoolean​(Object root,
                                                   String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or false if c could not be reached (due to b not having a c property, b being null, or c not being a boolean etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to selectBoolean(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created ObjectBinding
        Since:
        JavaFX 8.0
      • selectString

        public static StringBinding selectString​(Object root,
                                                 String... steps)
        Creates a binding used to get a member, such as a.b.c. The value of the binding will be c, or "" if c could not be reached (due to b not having a c property, b being null, or c not being a String etc.).

        All classes and properties used in a select-binding have to be declared public. Additionally, if any class is in a named module, then it must be reflectively accessible to the javafx.base module (see Deploying an Application as a Module).

        If root has JavaFX properties, this call is equivalent to selectString(javafx.beans.value.ObservableValue, java.lang.String[]), with the root and step[0] being substituted with the relevant property object.

        Parameters:
        root - The root bean.
        steps - The property names to reach the final property. The first step must be specified as it marks the property of the root bean.
        Returns:
        the created ObjectBinding
        Since:
        JavaFX 8.0
      • when

        public static When when​(ObservableBooleanValue condition)
        Creates a binding that calculates the result of a ternary expression. See the description of class When for details.
        Parameters:
        condition - the condition of the ternary expression
        Returns:
        an intermediate class to build the complete binding
        See Also:
        When
      • bindBidirectional

        public static <T> void bindBidirectional​(Property<T> property1,
                                                 Property<T> property2)
        Generates a bidirectional binding (or "bind with inverse") between two instances of Property.

        A bidirectional binding is a binding that works in both directions. If two properties a and b are linked with a bidirectional binding and the value of a changes, b is set to the same value automatically. And vice versa, if b changes, a is set to the same value.

        A bidirectional binding can be removed with unbindBidirectional(Property, Property).

        Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.

        Type Parameters:
        T - the types of the properties
        Parameters:
        property1 - the first Property<T>
        property2 - the second Property<T>
        Throws:
        NullPointerException - if one of the properties is null
        IllegalArgumentException - if both properties are equal
      • bindBidirectional

        public static void bindBidirectional​(Property<String> stringProperty,
                                             Property<?> otherProperty,
                                             Format format)
        Generates a bidirectional binding (or "bind with inverse") between a String-Property and another Property using the specified Format for conversion.

        A bidirectional binding is a binding that works in both directions. If two properties a and b are linked with a bidirectional binding and the value of a changes, b is set to the same value automatically. And vice versa, if b changes, a is set to the same value.

        A bidirectional binding can be removed with unbindBidirectional(Object, Object).

        Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.

        Parameters:
        stringProperty - the String Property
        otherProperty - the other (non-String) Property
        format - the Format used to convert between the properties
        Throws:
        NullPointerException - if one of the properties or the format is null
        IllegalArgumentException - if both properties are equal
        Since:
        JavaFX 2.1
      • bindBidirectional

        public static <T> void bindBidirectional​(Property<String> stringProperty,
                                                 Property<T> otherProperty,
                                                 StringConverter<T> converter)
        Generates a bidirectional binding (or "bind with inverse") between a String-Property and another Property using the specified StringConverter for conversion.

        A bidirectional binding is a binding that works in both directions. If two properties a and b are linked with a bidirectional binding and the value of a changes, b is set to the same value automatically. And vice versa, if b changes, a is set to the same value.

        A bidirectional binding can be removed with unbindBidirectional(Object, Object).

        Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.

        Type Parameters:
        T - the type of the wrapped Object
        Parameters:
        stringProperty - the String Property
        otherProperty - the other (non-String) Property
        converter - the StringConverter used to convert between the properties
        Throws:
        NullPointerException - if one of the properties or the converter is null
        IllegalArgumentException - if both properties are equal
        Since:
        JavaFX 2.1
      • bindContentBidirectional

        public static <E> void bindContentBidirectional​(ObservableList<E> list1,
                                                        ObservableList<E> list2)
        Generates a bidirectional binding (or "bind with inverse") between two instances of ObservableList.

        A bidirectional binding is a binding that works in both directions. If two properties a and b are linked with a bidirectional binding and the value of a changes, b is set to the same value automatically. And vice versa, if b changes, a is set to the same value.

        Only the content of the two lists is synchronized, which means that both lists are different, but they contain the same elements.

        A bidirectional content-binding can be removed with unbindContentBidirectional(Object, Object).

        Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.

        Type Parameters:
        E - the type of the list elements
        Parameters:
        list1 - the first ObservableList<E>
        list2 - the second ObservableList<E>
        Throws:
        NullPointerException - if one of the lists is null
        IllegalArgumentException - if list1 == list2
        Since:
        JavaFX 2.1
      • bindContentBidirectional

        public static <E> void bindContentBidirectional​(ObservableSet<E> set1,
                                                        ObservableSet<E> set2)
        Generates a bidirectional binding (or "bind with inverse") between two instances of ObservableSet.

        A bidirectional binding is a binding that works in both directions. If two properties a and b are linked with a bidirectional binding and the value of a changes, b is set to the same value automatically. And vice versa, if b changes, a is set to the same value.

        Only the content of the two sets is synchronized, which means that both sets are different, but they contain the same elements.

        A bidirectional content-binding can be removed with unbindContentBidirectional(Object, Object).

        Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.

        Type Parameters:
        E - the type of the set elements
        Parameters:
        set1 - the first ObservableSet<E>
        set2 - the second ObservableSet<E>
        Throws:
        NullPointerException - if one of the sets is null
        IllegalArgumentException - if set1 == set2
        Since:
        JavaFX 2.1
      • bindContentBidirectional

        public static <K,V> void bindContentBidirectional​(ObservableMap<K,V> map1,
                                                          ObservableMap<K,V> map2)
        Generates a bidirectional binding (or "bind with inverse") between two instances of ObservableMap.

        A bidirectional binding is a binding that works in both directions. If two properties a and b are linked with a bidirectional binding and the value of a changes, b is set to the same value automatically. And vice versa, if b changes, a is set to the same value.

        Only the content of the two maps is synchronized, which means that both maps are different, but they contain the same elements.

        A bidirectional content-binding can be removed with unbindContentBidirectional(Object, Object).

        Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.

        Type Parameters:
        K - the type of the key elements
        V - the type of the value elements
        Parameters:
        map1 - the first ObservableMap<K, V>
        map2 - the second ObservableMap<K, V>
        Since:
        JavaFX 2.1
      • unbindContentBidirectional

        public static void unbindContentBidirectional​(Object obj1,
                                                      Object obj2)
        Remove a bidirectional content binding.
        Parameters:
        obj1 - the first Object
        obj2 - the second Object
        Since:
        JavaFX 2.1
      • bindContent

        public static <E> void bindContent​(List<E> list1,
                                           ObservableList<? extends E> list2)
        Generates a content binding between an ObservableList and a List.

        A content binding ensures that the List contains the same elements as the ObservableList. If the content of the ObservableList changes, the List will be updated automatically.

        Once a List is bound to an ObservableList, the List must not be changed directly anymore. Doing so would lead to unexpected results.

        A content-binding can be removed with unbindContent(Object, Object).

        Type Parameters:
        E - the type of the List elements
        Parameters:
        list1 - the List
        list2 - the ObservableList
        Since:
        JavaFX 2.1
      • bindContent

        public static <E> void bindContent​(Set<E> set1,
                                           ObservableSet<? extends E> set2)
        Generates a content binding between an ObservableSet and a Set.

        A content binding ensures that the Set contains the same elements as the ObservableSet. If the content of the ObservableSet changes, the Set will be updated automatically.

        Once a Set is bound to an ObservableSet, the Set must not be changed directly anymore. Doing so would lead to unexpected results.

        A content-binding can be removed with unbindContent(Object, Object).

        Type Parameters:
        E - the type of the Set elements
        Parameters:
        set1 - the Set
        set2 - the ObservableSet
        Throws:
        NullPointerException - if one of the sets is null
        IllegalArgumentException - if set1 == set2
        Since:
        JavaFX 2.1
      • bindContent

        public static <K,V> void bindContent​(Map<K,V> map1,
                                             ObservableMap<? extends K,? extends V> map2)
        Generates a content binding between an ObservableMap and a Map.

        A content binding ensures that the Map contains the same elements as the ObservableMap. If the content of the ObservableMap changes, the Map will be updated automatically.

        Once a Map is bound to an ObservableMap, the Map must not be changed directly anymore. Doing so would lead to unexpected results.

        A content-binding can be removed with unbindContent(Object, Object).

        Type Parameters:
        K - the type of the key elements of the Map
        V - the type of the value elements of the Map
        Parameters:
        map1 - the Map
        map2 - the ObservableMap
        Throws:
        NullPointerException - if one of the maps is null
        IllegalArgumentException - if map1 == map2
        Since:
        JavaFX 2.1
      • unbindContent

        public static void unbindContent​(Object obj1,
                                         Object obj2)
        Remove a content binding.
        Parameters:
        obj1 - the first Object
        obj2 - the second Object
        Throws:
        NullPointerException - if one of the Objects is null
        IllegalArgumentException - if obj1 == obj2
        Since:
        JavaFX 2.1
      • equal

        public static BooleanBinding equal​(ObservableNumberValue op1,
                                           ObservableNumberValue op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the values of two instances of 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:
        op1 - the first operand
        op2 - the second operand
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if one of the operands is null
      • equal

        public static BooleanBinding equal​(ObservableNumberValue op1,
                                           double op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(double op1,
                                           ObservableNumberValue op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(ObservableNumberValue op1,
                                           float op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(float op1,
                                           ObservableNumberValue op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(ObservableNumberValue op1,
                                           long op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(long op1,
                                           ObservableNumberValue op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(ObservableNumberValue op1,
                                           int op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • equal

        public static BooleanBinding equal​(int op1,
                                           ObservableNumberValue op2,
                                           double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(ObservableNumberValue op1,
                                              ObservableNumberValue op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the values of two instances of ObservableNumberValue are not 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:
        op1 - the first operand
        op2 - the second operand
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if one of the operands is null
      • notEqual

        public static BooleanBinding notEqual​(ObservableNumberValue op1,
                                              double op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(double op1,
                                              ObservableNumberValue op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(ObservableNumberValue op1,
                                              float op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(float op1,
                                              ObservableNumberValue op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(ObservableNumberValue op1,
                                              long op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(long op1,
                                              ObservableNumberValue op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(ObservableNumberValue op1,
                                              int op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the ObservableNumberValue
        op2 - the constant value
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • notEqual

        public static BooleanBinding notEqual​(int op1,
                                              ObservableNumberValue op2,
                                              double epsilon)
        Creates a new BooleanBinding that holds true if the value of a ObservableNumberValue is not 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:
        op1 - the constant value
        op2 - the ObservableNumberValue
        epsilon - the permitted tolerance
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableNumberValue is null
      • convert

        public static StringExpression convert​(ObservableValue<?> observableValue)
        Returns a StringExpression that wraps a ObservableValue. If the ObservableValue is already a StringExpression, it will be returned. Otherwise a new StringBinding is created that holds the value of the ObservableValue converted to a String.
        Parameters:
        observableValue - The source ObservableValue
        Returns:
        A StringExpression that wraps the ObservableValue if necessary
        Throws:
        NullPointerException - if observableValue is null
      • concat

        public static StringExpression concat​(Object... args)
        Returns a StringExpression that holds the value of the concatenation of multiple Objects.

        If one of the arguments implements ObservableValue and the value of this ObservableValue changes, the change is automatically reflected in the StringExpression.

        If null or an empty array is passed to this method, a StringExpression that contains an empty String is returned

        Parameters:
        args - the Objects that should be concatenated
        Returns:
        the new StringExpression
      • format

        public static StringExpression format​(String format,
                                              Object... args)
        Creates a StringExpression that holds the value of multiple Objects formatted according to a format String.

        If one of the arguments implements ObservableValue and the value of this ObservableValue changes, the change is automatically reflected in the StringExpression.

        See java.util.Formatter for formatting rules.

        Parameters:
        format - the formatting String
        args - the Objects that should be inserted in the formatting String
        Returns:
        the new StringExpression
      • format

        public static StringExpression format​(Locale locale,
                                              String format,
                                              Object... args)
        Creates a StringExpression that holds the value of multiple Objects formatted according to a format String and a specified Locale

        If one of the arguments implements ObservableValue and the value of this ObservableValue changes, the change is automatically reflected in the StringExpression.

        See java.util.Formatter for formatting rules. See java.util.Locale for details on Locale.

        Parameters:
        locale - the Locale to use during formatting
        format - the formatting String
        args - the Objects that should be inserted in the formatting String
        Returns:
        the new StringExpression
      • equalIgnoreCase

        public static BooleanBinding equalIgnoreCase​(ObservableStringValue op1,
                                                     String op2)
        Creates a new BooleanBinding that holds true if the value of a ObservableStringValue is equal to a constant value ignoring case.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the ObservableStringValue
        op2 - the constant value
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • equalIgnoreCase

        public static BooleanBinding equalIgnoreCase​(String op1,
                                                     ObservableStringValue op2)
        Creates a new BooleanBinding that holds true if the value of a ObservableStringValue is equal to a constant value ignoring case.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the constant value
        op2 - the ObservableStringValue
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • notEqualIgnoreCase

        public static BooleanBinding notEqualIgnoreCase​(ObservableStringValue op1,
                                                        String op2)
        Creates a new BooleanBinding that holds true if the value of a ObservableStringValue is not equal to a constant value ignoring case.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the ObservableStringValue
        op2 - the constant value
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • notEqualIgnoreCase

        public static BooleanBinding notEqualIgnoreCase​(String op1,
                                                        ObservableStringValue op2)
        Creates a new BooleanBinding that holds true if the value of a ObservableStringValue is not equal to a constant value ignoring case.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the constant value
        op2 - the ObservableStringValue
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • greaterThan

        public static BooleanBinding greaterThan​(String op1,
                                                 ObservableStringValue op2)
        Creates a new BooleanBinding that holds true if the value of a constant value is greater than the value of a ObservableStringValue.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the constant value
        op2 - the ObservableStringValue
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • greaterThanOrEqual

        public static BooleanBinding greaterThanOrEqual​(ObservableStringValue op1,
                                                        String op2)
        Creates a new BooleanBinding that holds true if the value of a ObservableStringValue is greater than or equal to a constant value.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the ObservableStringValue
        op2 - the constant value
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • greaterThanOrEqual

        public static BooleanBinding greaterThanOrEqual​(String op1,
                                                        ObservableStringValue op2)
        Creates a new BooleanBinding that holds true if a constant value is greater than or equal to the value of a ObservableStringValue.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the constant value
        op2 - the ObservableStringValue
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • lessThanOrEqual

        public static BooleanBinding lessThanOrEqual​(ObservableStringValue op1,
                                                     String op2)
        Creates a new BooleanBinding that holds true if the value of a ObservableStringValue is less than or equal to a constant value.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the ObservableStringValue
        op2 - the constant value
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • lessThanOrEqual

        public static BooleanBinding lessThanOrEqual​(String op1,
                                                     ObservableStringValue op2)
        Creates a new BooleanBinding that holds true if a constant value is less than or equal to the value of a ObservableStringValue.

        Note: In this comparison a String that is null is considered equal to an empty String.

        Parameters:
        op1 - the constant value
        op2 - the ObservableStringValue
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableStringValue is null
      • valueAt

        public static <E> ObjectBinding<E> valueAt​(ObservableList<E> op,
                                                   int index)
        Creates a new ObjectBinding that contains the element of an ObservableList at the specified position. The ObjectBinding will contain null, if the index points behind the ObservableList.
        Type Parameters:
        E - the type of the List elements
        Parameters:
        op - the ObservableList
        index - the position in the List
        Returns:
        the new ObjectBinding
        Throws:
        NullPointerException - if the ObservableList is null
        IllegalArgumentException - if (@code index < 0)
        Since:
        JavaFX 2.1
      • valueAt

        public static <E> ObjectBinding<E> valueAt​(ObservableList<E> op,
                                                   ObservableIntegerValue index)
        Creates a new ObjectBinding that contains the element of an ObservableList at the specified position. The ObjectBinding will contain null, if the index is outside of the ObservableList.
        Type Parameters:
        E - the type of the List elements
        Parameters:
        op - the ObservableList
        index - the position in the List
        Returns:
        the new ObjectBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 2.1
      • valueAt

        public static <E> ObjectBinding<E> valueAt​(ObservableList<E> op,
                                                   ObservableNumberValue index)
        Creates a new ObjectBinding that contains the element of an ObservableList at the specified position. The ObjectBinding will contain null, if the index is outside of the ObservableList.
        Type Parameters:
        E - the type of the List elements
        Parameters:
        op - the ObservableList
        index - the position in the List, converted to int
        Returns:
        the new ObjectBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 8.0
      • doubleValueAt

        public static DoubleBinding doubleValueAt​(ObservableList<? extends Number> op,
                                                  int index)
        Creates a new DoubleBinding that contains the element of an ObservableList at the specified position. The DoubleBinding will hold 0.0, if the index points behind the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List
        Returns:
        the new DoubleBinding
        Throws:
        NullPointerException - if the ObservableList is null
        IllegalArgumentException - if (@code index < 0)
        Since:
        JavaFX 2.1
      • doubleValueAt

        public static DoubleBinding doubleValueAt​(ObservableList<? extends Number> op,
                                                  ObservableNumberValue index)
        Creates a new DoubleBinding that contains the element of an ObservableList at the specified position. The DoubleBinding will hold 0.0, if the index is outside of the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List, converted to int
        Returns:
        the new DoubleBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 8.0
      • floatValueAt

        public static FloatBinding floatValueAt​(ObservableList<? extends Number> op,
                                                int index)
        Creates a new FloatBinding that contains the element of an ObservableList at the specified position. The FloatBinding will hold 0.0f, if the index points behind the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List
        Returns:
        the new FloatBinding
        Throws:
        NullPointerException - if the ObservableList is null
        IllegalArgumentException - if (@code index < 0)
        Since:
        JavaFX 2.1
      • floatValueAt

        public static FloatBinding floatValueAt​(ObservableList<? extends Number> op,
                                                ObservableNumberValue index)
        Creates a new FloatBinding that contains the element of an ObservableList at the specified position. The FloatBinding will hold 0.0f, if the index is outside of the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List, converted to int
        Returns:
        the new FloatBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 8.0
      • integerValueAt

        public static IntegerBinding integerValueAt​(ObservableList<? extends Number> op,
                                                    ObservableNumberValue index)
        Creates a new IntegerBinding that contains the element of an ObservableList at the specified position. The IntegerBinding will hold 0, if the index is outside of the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List, converted to int
        Returns:
        the new IntegerBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 8.0
      • longValueAt

        public static LongBinding longValueAt​(ObservableList<? extends Number> op,
                                              int index)
        Creates a new LongBinding that contains the element of an ObservableList at the specified position. The LongBinding will hold 0L, if the index points behind the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List
        Returns:
        the new LongBinding
        Throws:
        NullPointerException - if the ObservableList is null
        IllegalArgumentException - if (@code index < 0)
        Since:
        JavaFX 2.1
      • longValueAt

        public static LongBinding longValueAt​(ObservableList<? extends Number> op,
                                              ObservableNumberValue index)
        Creates a new LongBinding that contains the element of an ObservableList at the specified position. The LongBinding will hold 0L, if the index is outside of the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List, converted to int
        Returns:
        the new LongBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 8.0
      • stringValueAt

        public static StringBinding stringValueAt​(ObservableList<String> op,
                                                  ObservableNumberValue index)
        Creates a new StringBinding that contains the element of an ObservableList at the specified position. The StringBinding will hold "", if the index is outside of the ObservableList.
        Parameters:
        op - the ObservableList
        index - the position in the List, converted to int
        Returns:
        the new StringBinding
        Throws:
        NullPointerException - if the ObservableList or index is null
        Since:
        JavaFX 8.0
      • floatValueAt

        public static FloatBinding floatValueAt​(ObservableFloatArray op,
                                                int index)
        Creates a new FloatBinding that contains the element of an ObservableArray at the specified position. The FloatBinding will hold 0.0f, if the index points behind the ObservableArray.
        Parameters:
        op - the ObservableArray
        index - the position in the ObservableArray
        Returns:
        the new FloatBinding
        Throws:
        NullPointerException - if the ObservableArray is null
        IllegalArgumentException - if (@code index < 0)
        Since:
        JavaFX 8.0
      • floatValueAt

        public static FloatBinding floatValueAt​(ObservableFloatArray op,
                                                ObservableNumberValue index)
        Creates a new FloatBinding that contains the element of an ObservableArray at the specified position. The FloatBinding will hold 0.0f, if the index is outside of the ObservableArray.
        Parameters:
        op - the ObservableArray
        index - the position in the ObservableArray, converted to int
        Returns:
        the new FloatBinding
        Throws:
        NullPointerException - if the ObservableArray or index is null
        Since:
        JavaFX 8.0
      • size

        public static <K,V> IntegerBinding size​(ObservableMap<K,V> op)
        Creates a new IntegerBinding that contains the size of an ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        V - type of the value elements of the Map
        Parameters:
        op - the ObservableMap
        Returns:
        the new IntegerBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • isEmpty

        public static <K,V> BooleanBinding isEmpty​(ObservableMap<K,V> op)
        Creates a new BooleanBinding that holds true if a given ObservableMap is empty.
        Type Parameters:
        K - type of the key elements of the Map
        V - type of the value elements of the Map
        Parameters:
        op - the ObservableMap
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • isNotEmpty

        public static <K,V> BooleanBinding isNotEmpty​(ObservableMap<K,V> op)
        Creates a new BooleanBinding that holds true if a given ObservableMap is not empty.
        Type Parameters:
        K - type of the key elements of the Map
        V - type of the value elements of the Map
        Parameters:
        op - the ObservableMap
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 8.0
      • valueAt

        public static <K,V> ObjectBinding<V> valueAt​(ObservableMap<K,V> op,
                                                     K key)
        Creates a new ObjectBinding that contains the mapping of a specific key in an ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        V - type of the value elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new ObjectBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • valueAt

        public static <K,V> ObjectBinding<V> valueAt​(ObservableMap<K,V> op,
                                                     ObservableValue<? extends K> key)
        Creates a new ObjectBinding that contains the mapping of a specific key in an ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        V - type of the value elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new ObjectBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1
      • booleanValueAt

        public static <K> BooleanBinding booleanValueAt​(ObservableMap<K,Boolean> op,
                                                        K key)
        Creates a new BooleanBinding that contains the mapping of a specific key in an ObservableMap. The BooleanBinding will hold false, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • booleanValueAt

        public static <K> BooleanBinding booleanValueAt​(ObservableMap<K,Boolean> op,
                                                        ObservableValue<? extends K> key)
        Creates a new BooleanBinding that contains the mapping of a specific key in an ObservableMap. The BooleanBinding will hold false, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new BooleanBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1
      • doubleValueAt

        public static <K> DoubleBinding doubleValueAt​(ObservableMap<K,? extends Number> op,
                                                      K key)
        Creates a new DoubleBinding that contains the mapping of a specific key in an ObservableMap. The DoubleBinding will hold 0.0, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new DoubleBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • doubleValueAt

        public static <K> DoubleBinding doubleValueAt​(ObservableMap<K,? extends Number> op,
                                                      ObservableValue<? extends K> key)
        Creates a new DoubleBinding that contains the mapping of a specific key in an ObservableMap. The DoubleBinding will hold 0.0, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new DoubleBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1
      • floatValueAt

        public static <K> FloatBinding floatValueAt​(ObservableMap<K,? extends Number> op,
                                                    K key)
        Creates a new FloatBinding that contains the mapping of a specific key in an ObservableMap. The FloatBinding will hold 0.0f, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new FloatBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • floatValueAt

        public static <K> FloatBinding floatValueAt​(ObservableMap<K,? extends Number> op,
                                                    ObservableValue<? extends K> key)
        Creates a new FloatBinding that contains the mapping of a specific key in an ObservableMap. The FloatBinding will hold 0.0f, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new FloatBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1
      • integerValueAt

        public static <K> IntegerBinding integerValueAt​(ObservableMap<K,? extends Number> op,
                                                        K key)
        Creates a new IntegerBinding that contains the mapping of a specific key in an ObservableMap. The IntegerBinding will hold 0, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new IntegerBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • integerValueAt

        public static <K> IntegerBinding integerValueAt​(ObservableMap<K,? extends Number> op,
                                                        ObservableValue<? extends K> key)
        Creates a new IntegerBinding that contains the mapping of a specific key in an ObservableMap. The IntegerBinding will hold 0, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new IntegerBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1
      • longValueAt

        public static <K> LongBinding longValueAt​(ObservableMap<K,? extends Number> op,
                                                  K key)
        Creates a new LongBinding that contains the mapping of a specific key in an ObservableMap. The LongBinding will hold 0L, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new LongBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • longValueAt

        public static <K> LongBinding longValueAt​(ObservableMap<K,? extends Number> op,
                                                  ObservableValue<? extends K> key)
        Creates a new LongBinding that contains the mapping of a specific key in an ObservableMap. The LongBinding will hold 0L, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new LongBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1
      • stringValueAt

        public static <K> StringBinding stringValueAt​(ObservableMap<K,String> op,
                                                      K key)
        Creates a new StringBinding that contains the mapping of a specific key in an ObservableMap. The StringBinding will hold null, if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new StringBinding
        Throws:
        NullPointerException - if the ObservableMap is null
        Since:
        JavaFX 2.1
      • stringValueAt

        public static <K> StringBinding stringValueAt​(ObservableMap<K,String> op,
                                                      ObservableValue<? extends K> key)
        Creates a new StringBinding that contains the mapping of a specific key in an ObservableMap. The StringBinding will hold "", if the key cannot be found in the ObservableMap.
        Type Parameters:
        K - type of the key elements of the Map
        Parameters:
        op - the ObservableMap
        key - the key in the Map
        Returns:
        the new StringBinding
        Throws:
        NullPointerException - if the ObservableMap or key is null
        Since:
        JavaFX 2.1