E - the type of the List elements.public abstract class ListExpression<E> extends java.lang.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 |
| 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)
A convenient method for var-arg adding of 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
|
ObservableList<E> |
getValue()
Returns the current value of this
ObservableValue |
int |
indexOf(java.lang.Object obj) |
boolean |
isEmpty()
Gets the value of the property empty.
|
BooleanBinding |
isEqualTo(ObservableList<?> other)
Creates a new
BooleanBinding that holds true if this list is equal to
another ObservableList. |
BooleanBinding |
isNotEqualTo(ObservableList<?> other)
Creates a new
BooleanBinding that holds true if this list is not equal to
another ObservableList. |
BooleanBinding |
isNotNull()
Creates a new
BooleanBinding that holds true if the wrapped list is not null. |
BooleanBinding |
isNull()
Creates a new
BooleanBinding that holds true if the wrapped list is null. |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object obj) |
static <E> ListExpression<E> |
listExpression(ObservableListValue<E> value)
Returns a
ListExpression that wraps a
ObservableListValue. |
java.util.ListIterator<E> |
listIterator() |
java.util.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(java.lang.Object obj) |
boolean |
removeAll(java.util.Collection<?> objects) |
boolean |
removeAll(E... elements)
A convenient method for var-arg usage of removaAll method.
|
boolean |
retainAll(java.util.Collection<?> objects) |
boolean |
retainAll(E... elements)
A convenient method for var-arg usage of retain method.
|
E |
set(int i,
E element) |
boolean |
setAll(java.util.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() |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetaddListener, removeListeneraddListener, removeListeneraddListener, removeListenerpublic 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 necessaryjava.lang.NullPointerException - 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 elementObjectBindingjava.lang.IllegalArgumentException - 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 elementObjectBindingjava.lang.NullPointerException - if index is nullpublic BooleanBinding isEqualTo(ObservableList<?> other)
BooleanBinding that holds true if this list is equal to
another ObservableList.other - the other ObservableListBooleanBindingjava.lang.NullPointerException - if other is nullpublic BooleanBinding isNotEqualTo(ObservableList<?> other)
BooleanBinding that holds true if this list is not equal to
another ObservableList.other - the other ObservableListBooleanBindingjava.lang.NullPointerException - if other is nullpublic BooleanBinding isNull()
BooleanBinding that holds true if the wrapped list is null.BooleanBindingpublic BooleanBinding isNotNull()
BooleanBinding that holds true if the wrapped list is not null.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(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)
addAll in interface java.util.List<E>public boolean removeAll(java.util.Collection<?> objects)
public boolean retainAll(java.util.Collection<?> objects)
public void clear()
public int indexOf(java.lang.Object obj)
indexOf in interface java.util.List<E>public int lastIndexOf(java.lang.Object obj)
lastIndexOf in interface java.util.List<E>public java.util.ListIterator<E> listIterator()
listIterator in interface java.util.List<E>public java.util.ListIterator<E> listIterator(int i)
listIterator in interface java.util.List<E>public java.util.List<E> subList(int from, int to)
subList in interface java.util.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(java.util.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, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.