Module javafx.base

Class ListExpression<E>

    • Constructor Detail

      • ListExpression

        public ListExpression()
    • Method Detail

      • listExpression

        public static <E> ListExpression<E> listExpression​(ObservableListValue<E> value)
        Returns a ListExpression that wraps a ObservableListValue. If the ObservableListValue is already a ListExpression, it will be returned. Otherwise a new ListBinding is created that is bound to the ObservableListValue.
        Type Parameters:
        E - the type of the wrapped List
        Parameters:
        value - The source ObservableListValue
        Returns:
        A ListExpression that wraps the ObservableListValue if necessary
        Throws:
        NullPointerException - if value is null
      • getSize

        public int getSize()
        The size of the list
        Returns:
        the size
      • valueAt

        public ObjectBinding<E> valueAt​(int index)
        Creates a new ObjectBinding that contains the element at the specified position. If index points behind the list, the ObjectBinding contains null.
        Parameters:
        index - the index of the element
        Returns:
        the ObjectBinding
        Throws:
        IllegalArgumentException - if index < 0
      • valueAt

        public ObjectBinding<E> valueAt​(ObservableIntegerValue index)
        Creates a new ObjectBinding that contains the element at the specified position. If index points outside of the list, the ObjectBinding contains null.
        Parameters:
        index - the index of the element
        Returns:
        the ObjectBinding
        Throws:
        NullPointerException - if index is null
      • isNull

        public BooleanBinding isNull()
        Creates a new BooleanBinding that holds true if the wrapped list is null.
        Returns:
        the new BooleanBinding
      • isNotNull

        public BooleanBinding isNotNull()
        Creates a new BooleanBinding that holds true if the wrapped list is not null.
        Returns:
        the new BooleanBinding
      • asString

        public StringBinding asString()
        Creates a StringBinding that holds the value of the ListExpression turned into a String. If the value of this ListExpression changes, the value of the StringBinding will be updated automatically.
        Returns:
        the new StringBinding