E - the type of the List elements.public abstract class ListExpression<E> extends Object implements ObservableListValue<E>
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.
| Type | Property and Description |
|---|---|
abstract ReadOnlyBooleanProperty |
empty
A boolean property that is
true, if the list is empty. |
abstract ReadOnlyIntegerProperty |
size
An integer property that represents the size of the list.
|
| Constructor and Description |
|---|
ListExpression() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
void |
add(int i,
E element) |
boolean |
addAll(Collection<? extends E> elements) |
boolean |
addAll(E... elements)
A convenient method for var-arg adding of elements.
|
boolean |
addAll(int i,
Collection<? extends E> elements) |
StringBinding |
asString()
|
void |
clear() |
boolean |
contains(Object obj) |
boolean |
containsAll(Collection<?> objects) |
abstract ReadOnlyBooleanProperty |
emptyProperty()
A boolean property that is
true, if the list is empty. |
E |
get(int i) |
int |
getSize()
The size of the list
|
ObservableList<E> |
getValue()
Returns the current value of this
ObservableValue |
int |
indexOf(Object obj) |
boolean |
isEmpty()
Gets the value of the property empty.
|
BooleanBinding |
isEqualTo(ObservableList<?> other)
|
BooleanBinding |
isNotEqualTo(ObservableList<?> other)
|
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
Iterator<E> |
iterator() |
int |
lastIndexOf(Object obj) |
static <E> ListExpression<E> |
listExpression(ObservableListValue<E> value)
Returns a
ListExpression that wraps a
ObservableListValue. |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int i) |
E |
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 |
remove(Object obj) |
boolean |
removeAll(Collection<?> objects) |
boolean |
removeAll(E... elements)
A convenient method for var-arg usage of removaAll method.
|
boolean |
retainAll(Collection<?> objects) |
boolean |
retainAll(E... elements)
A convenient method for var-arg usage of retain method.
|
E |
set(int i,
E element) |
boolean |
setAll(Collection<? extends E> elements)
Clears the ObservableList and add all elements from the collection.
|
boolean |
setAll(E... elements)
Clears the ObservableList and add all the elements passed as var-args.
|
int |
size() |
abstract ReadOnlyIntegerProperty |
sizeProperty()
An integer property that represents the size of the list.
|
List<E> |
subList(int from,
int to) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
ObjectBinding<E> |
valueAt(int index)
Creates a new
ObjectBinding that contains the element at the specified position. |
ObjectBinding<E> |
valueAt(ObservableIntegerValue index)
Creates a new
ObjectBinding that contains the element at the specified position. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetaddListener, removeListeneraddListener, removeListeneraddListener, filtered, removeListener, sorted, sortedequals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streampublic abstract ReadOnlyIntegerProperty sizeProperty
getSize()public abstract ReadOnlyBooleanProperty emptyProperty
true, if the list is empty.isEmpty()public ObservableList<E> getValue()
ObservableValueObservableValuegetValue in interface ObservableValue<ObservableList<E>>public static <E> ListExpression<E> listExpression(ObservableListValue<E> value)
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.value - The source ObservableListValueListExpression that wraps the
ObservableListValue if necessaryNullPointerException - if value is nullpublic int getSize()
public abstract ReadOnlyIntegerProperty sizeProperty()
getSize()public abstract ReadOnlyBooleanProperty emptyProperty()
true, if the list is empty.isEmpty()public ObjectBinding<E> valueAt(int index)
ObjectBinding that contains the element at the specified position.
If index points behind the list, the ObjectBinding contains null.index - the index of the elementObjectBindingIllegalArgumentException - if index < 0public ObjectBinding<E> valueAt(ObservableIntegerValue index)
ObjectBinding that contains the element at the specified position.
If index points outside of the list, the ObjectBinding contains null.index - the index of the elementObjectBindingNullPointerException - if index is nullpublic BooleanBinding isEqualTo(ObservableList<?> other)
other - the other ObservableListBooleanBindingNullPointerException - if other is nullpublic BooleanBinding isNotEqualTo(ObservableList<?> other)
other - the other ObservableListBooleanBindingNullPointerException - if other is nullpublic BooleanBinding isNull()
BooleanBindingpublic BooleanBinding isNotNull()
BooleanBindingpublic StringBinding asString()
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.StringBindingpublic int size()
public boolean isEmpty()
public boolean contains(Object obj)
public Object[] toArray()
public <T> T[] toArray(T[] array)
public boolean add(E element)
public boolean remove(Object obj)
public boolean containsAll(Collection<?> objects)
containsAll in interface Collection<E>containsAll in interface List<E>public boolean addAll(Collection<? extends E> elements)
public boolean addAll(int i,
Collection<? extends E> elements)
public boolean removeAll(Collection<?> objects)
public boolean retainAll(Collection<?> objects)
public void clear()
public int lastIndexOf(Object obj)
lastIndexOf in interface List<E>public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int i)
listIterator in interface List<E>public boolean addAll(E... elements)
ObservableListaddAll in interface ObservableList<E>elements - the elements to addpublic boolean setAll(E... elements)
ObservableListsetAll in interface ObservableList<E>elements - the elements to setpublic boolean setAll(Collection<? extends E> elements)
ObservableListsetAll in interface ObservableList<E>elements - the collection with elements that will be added to this observableArrayListpublic boolean removeAll(E... elements)
ObservableListremoveAll in interface ObservableList<E>elements - the elements to be removedpublic boolean retainAll(E... elements)
ObservableListretainAll in interface ObservableList<E>elements - the elements to be retainedpublic void remove(int from,
int to)
ObservableListremove in interface ObservableList<E>from - the start of the range to remove (inclusive)to - the end of the range to remove (exclusive)Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.