E
- the type of the List
elements.public abstract class ListExpression<E>
extends java.lang.Object
ListExpression
is an
javafx.beans.value.ObservableListValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of ListExpression
has to implement the method
javafx.beans.value.ObservableListValue#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.
|
Modifier and Type | Field and Description |
---|---|
private static ObservableList |
EMPTY_LIST |
Constructor and Description |
---|
ListExpression() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element) |
void |
add(int i,
E element) |
boolean |
addAll(java.util.Collection<? extends E> elements) |
boolean |
addAll(E... elements) |
boolean |
addAll(int i,
java.util.Collection<? extends E> elements) |
StringBinding |
asString()
|
void |
clear() |
boolean |
contains(java.lang.Object obj) |
boolean |
containsAll(java.util.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
|
<any> |
getValue() |
int |
indexOf(java.lang.Object obj) |
boolean |
isEmpty()
Gets the value of the property empty.
|
BooleanBinding |
isEqualTo(<any> other)
Creates a new
BooleanBinding that holds true if this list is equal to
another javafx.collections.ObservableList . |
BooleanBinding |
isNotEqualTo(<any> other)
Creates a new
BooleanBinding that holds true if this list is not equal to
another javafx.collections.ObservableList . |
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object obj) |
static <E> ListExpression<E> |
listExpression(<any> value)
Returns a
ListExpression that wraps a
javafx.beans.value.ObservableListValue . |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int i) |
E |
remove(int i) |
void |
remove(int from,
int to) |
boolean |
remove(java.lang.Object obj) |
boolean |
removeAll(java.util.Collection<?> objects) |
boolean |
removeAll(E... elements) |
boolean |
retainAll(java.util.Collection<?> objects) |
boolean |
retainAll(E... elements) |
E |
set(int i,
E element) |
boolean |
setAll(java.util.Collection<? extends E> elements) |
boolean |
setAll(E... elements) |
int |
size() |
abstract ReadOnlyIntegerProperty |
sizeProperty()
An integer property that represents the size of the list.
|
java.util.List<E> |
subList(int from,
int to) |
java.lang.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. |
public abstract ReadOnlyIntegerProperty sizeProperty
getSize()
public abstract ReadOnlyBooleanProperty emptyProperty
true
, if the list is empty.isEmpty()
public <any> getValue()
public static <E> ListExpression<E> listExpression(<any> value)
ListExpression
that wraps a
javafx.beans.value.ObservableListValue
. If the
ObservableListValue
is already a ListExpression
, it
will be returned. Otherwise a new
ListBinding
is created that is bound to
the ObservableListValue
.E
- the type of the wrapped List
value
- The source ObservableListValue
ListExpression
that wraps the
ObservableListValue
if necessaryjava.lang.NullPointerException
- if value
is null
public 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 elementObjectBinding
java.lang.IllegalArgumentException
- if index < 0
public 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 elementObjectBinding
java.lang.NullPointerException
- if index
is null
public BooleanBinding isEqualTo(<any> other)
BooleanBinding
that holds true
if this list is equal to
another javafx.collections.ObservableList
.other
- the other ObservableList
BooleanBinding
java.lang.NullPointerException
- if other
is null
public BooleanBinding isNotEqualTo(<any> other)
BooleanBinding
that holds true
if this list is not equal to
another javafx.collections.ObservableList
.other
- the other ObservableList
BooleanBinding
java.lang.NullPointerException
- if other
is null
public BooleanBinding isNull()
BooleanBinding
public BooleanBinding isNotNull()
BooleanBinding
public 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.StringBinding
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object obj)
public java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] array)
public boolean add(E element)
public boolean remove(java.lang.Object obj)
public boolean containsAll(java.util.Collection<?> objects)
public boolean addAll(java.util.Collection<? extends E> elements)
public boolean addAll(int i, java.util.Collection<? extends E> elements)
public boolean removeAll(java.util.Collection<?> objects)
public boolean retainAll(java.util.Collection<?> objects)
public void clear()
public E get(int i)
public void add(int i, E element)
public E remove(int i)
public int indexOf(java.lang.Object obj)
public int lastIndexOf(java.lang.Object obj)
public java.util.ListIterator<E> listIterator()
public java.util.ListIterator<E> listIterator(int i)
public java.util.List<E> subList(int from, int to)
public boolean addAll(E... elements)
public boolean setAll(E... elements)
public boolean setAll(java.util.Collection<? extends E> elements)
public boolean removeAll(E... elements)
public boolean retainAll(E... elements)
public void remove(int from, int to)