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
      • isEmpty

        public boolean isEmpty()
        Gets the value of the property empty.
        Specified by:
        isEmpty in interface Collection<E>
        Specified by:
        isEmpty in interface List<E>
        Property description:
        A boolean property that is true, if the list is empty.
      • add

        public boolean add​(E element)
        Specified by:
        add in interface Collection<E>
        Specified by:
        add in interface List<E>
      • addAll

        public boolean addAll​(int i,
                              Collection<? extends E> elements)
        Specified by:
        addAll in interface List<E>
      • get

        public E get​(int i)
        Specified by:
        get in interface List<E>
      • set

        public E set​(int i,
                     E element)
        Specified by:
        set in interface List<E>
      • add

        public void add​(int i,
                        E element)
        Specified by:
        add in interface List<E>
      • remove

        public E remove​(int i)
        Specified by:
        remove in interface List<E>
      • indexOf

        public int indexOf​(Object obj)
        Specified by:
        indexOf in interface List<E>
      • subList

        public List<E> subList​(int from,
                               int to)
        Specified by:
        subList in interface List<E>
      • addAll

        public boolean addAll​(E... elements)
        Description copied from interface: ObservableList
        A convenience method for var-arg addition of elements.
        Specified by:
        addAll in interface ObservableList<E>
        Parameters:
        elements - the elements to add
        Returns:
        true (as specified by Collection.add(E))
      • setAll

        public boolean setAll​(E... elements)
        Description copied from interface: ObservableList
        Clears the ObservableList and adds all the elements passed as var-args.
        Specified by:
        setAll in interface ObservableList<E>
        Parameters:
        elements - the elements to set
        Returns:
        true (as specified by Collection.add(E))
      • setAll

        public boolean setAll​(Collection<? extends E> elements)
        Description copied from interface: ObservableList
        Clears the ObservableList and adds all elements from the collection.
        Specified by:
        setAll in interface ObservableList<E>
        Parameters:
        elements - the collection with elements that will be added to this observableArrayList
        Returns:
        true (as specified by Collection.add(E))
      • removeAll

        public boolean removeAll​(E... elements)
        Description copied from interface: ObservableList
        A convenience method for var-arg usage of the removeAll method.
        Specified by:
        removeAll in interface ObservableList<E>
        Parameters:
        elements - the elements to be removed
        Returns:
        true if list changed as a result of this call
      • retainAll

        public boolean retainAll​(E... elements)
        Description copied from interface: ObservableList
        A convenience method for var-arg usage of the retainAll method.
        Specified by:
        retainAll in interface ObservableList<E>
        Parameters:
        elements - the elements to be retained
        Returns:
        true if list changed as a result of this call
      • remove

        public void remove​(int from,
                           int to)
        Description copied from interface: ObservableList
        A simplified way of calling sublist(from, to).clear(). As this is a common operation, ObservableList has this method for convenient usage.
        Specified by:
        remove in interface ObservableList<E>
        Parameters:
        from - the start of the range to remove (inclusive)
        to - the end of the range to remove (exclusive)