Package javafx.beans.binding
Class ListExpression<E>
java.lang.Object
javafx.beans.binding.ListExpression<E>
- Type Parameters:
E
- the type of theList
elements.
- 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
TypePropertyDescriptionabstract ReadOnlyBooleanProperty
A boolean property that istrue
, if the list is empty.abstract ReadOnlyIntegerProperty
An integer property that represents the size of the list. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int i, Collection<? extends E> elements) boolean
A convenient method for var-arg adding of elements.boolean
addAll
(Collection<? extends E> elements) void
clear()
boolean
boolean
containsAll
(Collection<?> objects) abstract ReadOnlyBooleanProperty
A boolean property that istrue
, if the list is empty.get
(int i) int
getSize()
The size of the listgetValue()
Returns the current value of thisObservableValue
int
boolean
isEmpty()
Gets the value of theempty
property.iterator()
int
lastIndexOf
(Object obj) listIterator
(int i) remove
(int i) void
remove
(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.boolean
boolean
A convenient method for var-arg usage of removaAll method.boolean
removeAll
(Collection<?> objects) boolean
A convenient method for var-arg usage of retain method.boolean
retainAll
(Collection<?> objects) boolean
Clears the ObservableList and add all the elements passed as var-args.boolean
setAll
(Collection<? extends E> elements) Clears the ObservableList and add all elements from the collection.int
size()
abstract ReadOnlyIntegerProperty
An 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, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
Methods inherited from interface javafx.collections.ObservableList
addListener, filtered, removeListener, sorted
Methods inherited from interface javafx.beans.value.ObservableObjectValue
get
Methods 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:ObservableValue
Returns the current value of thisObservableValue
- Specified by:
getValue
in 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
empty
property - See Also:
-
size
public int size()Creates aStringBinding
that holds the value of theListExpression
turned into aString
. If the value of thisListExpression
changes, the value of theStringBinding
will be updated automatically. -
isEmpty
public boolean isEmpty()Gets the value of theempty
property. -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] array) -
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<E>
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
subList
-
addAll
Description copied from interface:ObservableList
A convenient method for var-arg adding of elements.- Specified by:
addAll
in interfaceObservableList<E>
- Parameters:
elements
- the elements to add- Returns:
- true (as specified by Collection.add(E))
-
setAll
Description copied from interface:ObservableList
Clears the ObservableList and add all the elements passed as var-args.- Specified by:
setAll
in interfaceObservableList<E>
- Parameters:
elements
- the elements to set- Returns:
- true (as specified by Collection.add(E))
-
setAll
Description copied from interface:ObservableList
Clears the ObservableList and add all elements from the collection.- Specified by:
setAll
in 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:ObservableList
A convenient method for var-arg usage of removaAll method.- Specified by:
removeAll
in 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:ObservableList
A convenient method for var-arg usage of retain method.- Specified by:
retainAll
in 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:ObservableList
Basically a shortcut to sublist(from, to).clear() As this is a common operation, ObservableList has this method for convenient usage.- Specified by:
remove
in interfaceObservableList<E>
- Parameters:
from
- the start of the range to remove (inclusive)to
- the end of the range to remove (exclusive)
-