java.lang.Object
javafx.beans.binding.ListExpression<E>
- Type Parameters:
- E- the type of the- Listelements.
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- List<E>,- SequencedCollection<E>,- Observable,- ObservableListValue<E>,- ObservableObjectValue<ObservableList<E>>,- ObservableValue<ObservableList<E>>,- ObservableList<E>
- Direct Known Subclasses:
- ListBinding,- ReadOnlyListProperty
ListExpression is an
 ObservableListValue plus additional convenience
 methods to generate bindings in a fluent style.
 
 A concrete sub-class of ListExpression has to implement the method
 ObservableObjectValue.get(), which provides the
 actual value of this expression.
 
 If the wrapped list of a ListExpression is null, all methods implementing the List
 interface will behave as if they were applied to an immutable empty list.
- Since:
- JavaFX 2.1
- 
Property SummaryPropertiesTypePropertyDescriptionabstract ReadOnlyBooleanPropertyA boolean property that istrue, if the list is empty.abstract ReadOnlyIntegerPropertyAn integer property that represents the size of the list.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int i, Collection<? extends E> elements) booleanA convenience method for var-arg addition of elements.booleanaddAll(Collection<? extends E> elements) asString()voidclear()booleanbooleancontainsAll(Collection<?> objects) abstract ReadOnlyBooleanPropertyA boolean property that istrue, if the list is empty.get(int i) intgetSize()The size of the listgetValue()Returns the current value of thisObservableValueintbooleanisEmpty()Gets the value of theemptyproperty.isEqualTo(ObservableList<?> other) isNotEqualTo(ObservableList<?> other) isNull()iterator()intlastIndexOf(Object obj) static <E> ListExpression<E> listExpression(ObservableListValue<E> value) Returns aListExpressionthat wraps aObservableListValue.listIterator(int i) remove(int i) voidremove(int from, int to) A simplified way of callingsublist(from, to).clear().booleanbooleanA convenience method for var-arg usage of theremoveAllmethod.booleanremoveAll(Collection<?> objects) booleanA convenience method for var-arg usage of theretainAllmethod.booleanretainAll(Collection<?> objects) booleanClears the ObservableList and adds all the elements passed as var-args.booleansetAll(Collection<? extends E> elements) Clears the ObservableList and adds all elements from the collection.intsize()abstract ReadOnlyIntegerPropertyAn integer property that represents the size of the list.subList(int from, int to) Object[]toArray()<T> T[]toArray(T[] array) valueAt(int index) Creates a newObjectBindingthat contains the element at the specified position.valueAt(ObservableIntegerValue index) Creates a newObjectBindingthat contains the element at the specified position.Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods declared in interface java.util.ListaddFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliteratorMethods declared in interface javafx.beans.ObservableaddListener, removeListener, subscribeMethods declared in interface javafx.collections.ObservableListaddListener, filtered, removeListener, sorted, sortedMethods declared in interface javafx.beans.value.ObservableObjectValuegetMethods declared in interface javafx.beans.value.ObservableValueaddListener, flatMap, map, orElse, removeListener, subscribe, subscribe, when
- 
Property Details- 
sizeAn integer property that represents the size of the list.- See Also:
 
- 
emptyA boolean property that istrue, if the list is empty.- See Also:
 
 
- 
- 
Constructor Details- 
ListExpressionpublic ListExpression()Creates a defaultListExpression.
 
- 
- 
Method Details- 
getValueDescription copied from interface:ObservableValueReturns the current value of thisObservableValue- Specified by:
- getValuein interface- ObservableValue<E>
- Returns:
- The current value
 
- 
listExpressionReturns aListExpressionthat wraps aObservableListValue. If theObservableListValueis already aListExpression, it will be returned. Otherwise a newListBindingis created that is bound to theObservableListValue.- Type Parameters:
- E- the type of the wrapped- List
- Parameters:
- value- The source- ObservableListValue
- Returns:
- A ListExpressionthat wraps theObservableListValueif necessary
- Throws:
- NullPointerException- if- valueis- null
 
- 
getSizepublic int getSize()The size of the list- Returns:
- the size
 
- 
sizePropertyAn integer property that represents the size of the list.- Returns:
- the property
- See Also:
 
- 
emptyPropertyA boolean property that istrue, if the list is empty.- Returns:
- the ReadOnlyBooleanProperty
- See Also:
 
- 
valueAtCreates a newObjectBindingthat contains the element at the specified position. Ifindexpoints behind the list, theObjectBindingcontainsnull.- Parameters:
- index- the index of the element
- Returns:
- the ObjectBinding
- Throws:
- IllegalArgumentException- if- index < 0
 
- 
valueAtCreates a newObjectBindingthat contains the element at the specified position. Ifindexpoints outside of the list, theObjectBindingcontainsnull.- Parameters:
- index- the index of the element
- Returns:
- the ObjectBinding
- Throws:
- NullPointerException- if- indexis- null
 
- 
isEqualTo- Parameters:
- other- the other- ObservableList
- Returns:
- the new BooleanBinding
- Throws:
- NullPointerException- if- otheris- null
 
- 
isNotEqualTo- Parameters:
- other- the other- ObservableList
- Returns:
- the new BooleanBinding
- Throws:
- NullPointerException- if- otheris- null
 
- 
isNull- Returns:
- the new BooleanBinding
 
- 
isNotNull- Returns:
- the new BooleanBinding
 
- 
asStringCreates aStringBindingthat holds the value of theListExpressionturned into aString. If the value of thisListExpressionchanges, the value of theStringBindingwill be updated automatically.- Returns:
- the new StringBinding
 
- 
sizepublic int size()
- 
isEmptypublic boolean isEmpty()Gets the value of theemptyproperty.
- 
contains
- 
iterator
- 
toArray
- 
toArraypublic <T> T[] toArray(T[] array) 
- 
add
- 
remove
- 
containsAll- Specified by:
- containsAllin interface- Collection<E>
- Specified by:
- containsAllin interface- List<E>
 
- 
addAll
- 
addAll
- 
removeAll
- 
retainAll
- 
clearpublic void clear()
- 
get
- 
set
- 
add
- 
remove
- 
indexOf
- 
lastIndexOf- Specified by:
- lastIndexOfin interface- List<E>
 
- 
listIterator- Specified by:
- listIteratorin interface- List<E>
 
- 
listIterator- Specified by:
- listIteratorin interface- List<E>
 
- 
subList
- 
addAllDescription copied from interface:ObservableListA convenience method for var-arg addition of elements.- Specified by:
- addAllin interface- ObservableList<E>
- Parameters:
- elements- the elements to add
- Returns:
- true (as specified by Collection.add(E))
 
- 
setAllDescription copied from interface:ObservableListClears the ObservableList and adds all the elements passed as var-args.- Specified by:
- setAllin interface- ObservableList<E>
- Parameters:
- elements- the elements to set
- Returns:
- true (as specified by Collection.add(E))
 
- 
setAllDescription copied from interface:ObservableListClears the ObservableList and adds all elements from the collection.- Specified by:
- setAllin interface- ObservableList<E>
- Parameters:
- elements- the collection with elements that will be added to this observableArrayList
- Returns:
- true (as specified by Collection.add(E))
 
- 
removeAllDescription copied from interface:ObservableListA convenience method for var-arg usage of theremoveAllmethod.- Specified by:
- removeAllin interface- ObservableList<E>
- Parameters:
- elements- the elements to be removed
- Returns:
- true if list changed as a result of this call
 
- 
retainAllDescription copied from interface:ObservableListA convenience method for var-arg usage of theretainAllmethod.- Specified by:
- retainAllin interface- ObservableList<E>
- Parameters:
- elements- the elements to be retained
- Returns:
- true if list changed as a result of this call
 
- 
removepublic void remove(int from, int to) Description copied from interface:ObservableListA simplified way of callingsublist(from, to).clear(). As this is a common operation, ObservableList has this method for convenient usage.- Specified by:
- removein interface- ObservableList<E>
- Parameters:
- from- the start of the range to remove (inclusive)
- to- the end of the range to remove (exclusive)
 
 
-