Package javafx.beans.binding
Class ListExpression<E>
java.lang.Object
javafx.beans.binding.ListExpression<E>
- Type Parameters:
E- the type of theListelements.
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,Observable,ObservableListValue<E>,ObservableObjectValue<ObservableList<E>>,ObservableValue<ObservableList<E>>,ObservableList<E>
- Direct Known Subclasses:
ReadOnlyListProperty
A
ListExpression is a
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 Summary
PropertiesTypePropertyDescriptionabstract ReadOnlyBooleanPropertyA boolean property that istrue, if the list is empty.abstract ReadOnlyIntegerPropertyAn integer property that represents the size of the list. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int i, Collection<? extends E> elements) booleanA convenient method for var-arg adding of elements.booleanaddAll(Collection<? extends E> elements) 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.iterator()intlastIndexOf(Object obj) listIterator(int i) remove(int i) voidremove(int from, int to) Basically a shortcut to sublist(from, to).clear() As this is a common operation, ObservableList has this method for convenient usage.booleanbooleanA convenient method for var-arg usage of removaAll method.booleanremoveAll(Collection<?> objects) booleanA convenient method for var-arg usage of retain method.booleanretainAll(Collection<?> objects) booleanClears the ObservableList and add all the elements passed as var-args.booleansetAll(Collection<? extends E> elements) Clears the ObservableList and add 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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliteratorMethods inherited from interface javafx.beans.Observable
addListener, removeListenerMethods inherited from interface javafx.collections.ObservableList
addListener, filtered, removeListener, sortedMethods inherited from interface javafx.beans.value.ObservableObjectValue
getMethods inherited from interface javafx.beans.value.ObservableValue
addListener, removeListener
-
Property Details
-
size
An integer property that represents the size of the list.- See Also:
-
empty
A boolean property that istrue, if the list is empty.- See Also:
-
-
Constructor Details
-
ListExpression
public ListExpression()
-
-
Method Details
-
getValue
Description copied from interface:ObservableValueReturns the current value of thisObservableValue- Specified by:
getValuein interfaceObservableValue<E>- Returns:
- The current value
-
getSize
public int getSize()The size of the list -
sizeProperty
An integer property that represents the size of the list.- Returns:
- the property
- See Also:
-
emptyProperty
A boolean property that istrue, if the list is empty.- Returns:
- the
emptyproperty - See Also:
-
size
public int size()Creates aStringBindingthat holds the value of theListExpressionturned into aString. If the value of thisListExpressionchanges, the value of theStringBindingwill be updated automatically. -
isEmpty
public boolean isEmpty()Gets the value of theemptyproperty. -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] array) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
subList
-
addAll
Description copied from interface:ObservableListA convenient method for var-arg adding of elements.- Specified by:
addAllin interfaceObservableList<E>- Parameters:
elements- the elements to add- Returns:
- true (as specified by Collection.add(E))
-
setAll
Description copied from interface:ObservableListClears the ObservableList and add all the elements passed as var-args.- Specified by:
setAllin interfaceObservableList<E>- Parameters:
elements- the elements to set- Returns:
- true (as specified by Collection.add(E))
-
setAll
Description copied from interface:ObservableListClears the ObservableList and add all elements from the collection.- Specified by:
setAllin interfaceObservableList<E>- Parameters:
elements- the collection with elements that will be added to this observableArrayList- Returns:
- true (as specified by Collection.add(E))
-
removeAll
Description copied from interface:ObservableListA convenient method for var-arg usage of removaAll method.- Specified by:
removeAllin interfaceObservableList<E>- Parameters:
elements- the elements to be removed- Returns:
- true if list changed as a result of this call
-
retainAll
Description copied from interface:ObservableListA convenient method for var-arg usage of retain method.- Specified by:
retainAllin interfaceObservableList<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:ObservableListBasically a shortcut to sublist(from, to).clear() As this is a common operation, ObservableList has this method for convenient usage.- Specified by:
removein interfaceObservableList<E>- Parameters:
from- the start of the range to remove (inclusive)to- the end of the range to remove (exclusive)
-