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:
ListBinding,ReadOnlyListProperty
public abstract class ListExpression<E> extends Object implements ObservableListValue<E>
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 Summary
Properties Type Property Description abstract ReadOnlyBooleanPropertyemptyA boolean property that istrue, if the list is empty.abstract ReadOnlyIntegerPropertysizeAn integer property that represents the size of the list. -
Constructor Summary
Constructors Constructor Description ListExpression()Creates a defaultListExpression. -
Method Summary
Modifier and Type Method Description StringBindingasString()abstract ReadOnlyBooleanPropertyemptyProperty()A boolean property that istrue, if the list is empty.intgetSize()The size of the listBooleanBindingisEqualTo(ObservableList<?> other)BooleanBindingisNotEqualTo(ObservableList<?> other)BooleanBindingisNotNull()BooleanBindingisNull()static <E> ListExpression<E>listExpression(ObservableListValue<E> value)Returns aListExpressionthat wraps aObservableListValue.abstract ReadOnlyIntegerPropertysizeProperty()An integer property that represents the size of the list.ObjectBinding<E>valueAt(int index)Creates a newObjectBindingthat contains the element at the specified position.ObjectBinding<E>valueAt(ObservableIntegerValue index)Creates a newObjectBindingthat contains the element at the specified position.Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods declared in interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArrayMethods declared in interface javafx.beans.Observable
addListener, removeListenerMethods declared in interface javafx.collections.ObservableList
addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sortedMethods declared in interface javafx.beans.value.ObservableObjectValue
getMethods declared in interface javafx.beans.value.ObservableValue
addListener, getValue, removeListener
-
Property Details
-
size
An integer property that represents the size of the list.- See Also:
getSize()
-
empty
A boolean property that istrue, if the list is empty.- See Also:
List.isEmpty()
-
-
Constructor Details
-
ListExpression
public ListExpression()Creates a defaultListExpression.
-
-
Method Details
-
listExpression
Returns 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 wrappedList- Parameters:
value- The sourceObservableListValue- Returns:
- A
ListExpressionthat wraps theObservableListValueif necessary - Throws:
NullPointerException- ifvalueisnull
-
getSize
public int getSize()The size of the list- Returns:
- the size
-
sizeProperty
An integer property that represents the size of the list.- See Also:
getSize()
-
emptyProperty
A boolean property that istrue, if the list is empty.- See Also:
List.isEmpty()
-
valueAt
Creates 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- ifindex < 0
-
valueAt
Creates 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- ifindexisnull
-
isEqualTo
- Parameters:
other- the otherObservableList- Returns:
- the new
BooleanBinding - Throws:
NullPointerException- ifotherisnull
-
isNotEqualTo
- Parameters:
other- the otherObservableList- Returns:
- the new
BooleanBinding - Throws:
NullPointerException- ifotherisnull
-
isNull
- Returns:
- the new
BooleanBinding
-
isNotNull
- Returns:
- the new
BooleanBinding
-
asString
Creates aStringBindingthat holds the value of theListExpressionturned into aString. If the value of thisListExpressionchanges, the value of theStringBindingwill be updated automatically.- Returns:
- the new
StringBinding
-