private static class FXCollections.SingletonObservableList<E> extends java.util.AbstractList<E> implements ObservableList<E>
Constructor and Description |
---|
SingletonObservableList(E element) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(E... elements)
A convenience method for var-arg addition of elements.
|
void |
addListener(InvalidationListener listener)
Add a listener to this observable list.
|
boolean |
contains(java.lang.Object o) |
E |
get(int index) |
boolean |
isEmpty() |
void |
remove(int from,
int to)
A simplified way of calling
sublist(from, to).clear() . |
boolean |
removeAll(E... elements)
A convenience method for var-arg usage of the
removeAll method. |
void |
removeListener(InvalidationListener listener)
Tries to remove a listener from this observable list.
|
boolean |
retainAll(E... elements)
A convenience method for var-arg usage of the
retainAll method. |
boolean |
setAll(java.util.Collection<? extends E> col)
Clears the ObservableList and adds all elements from the collection.
|
boolean |
setAll(E... elements)
Clears the ObservableList and adds all the elements passed as var-args.
|
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
filtered, sorted, sorted
private final E element
public SingletonObservableList(E element)
public boolean addAll(E... elements)
ObservableList
addAll
in interface ObservableList<E>
elements
- the elements to addpublic boolean setAll(E... elements)
ObservableList
setAll
in interface ObservableList<E>
elements
- the elements to setpublic boolean setAll(java.util.Collection<? extends E> col)
ObservableList
setAll
in interface ObservableList<E>
col
- the collection with elements that will be added to this observableArrayListpublic boolean removeAll(E... elements)
ObservableList
removeAll
method.removeAll
in interface ObservableList<E>
elements
- the elements to be removedpublic boolean retainAll(E... elements)
ObservableList
retainAll
method.retainAll
in interface ObservableList<E>
elements
- the elements to be retainedpublic void remove(int from, int to)
ObservableList
sublist(from, to).clear()
. As this is a common operation,
ObservableList has this method for convenient usage.remove
in interface ObservableList<E>
from
- the start of the range to remove (inclusive)to
- the end of the range to remove (exclusive)public void addListener(InvalidationListener listener)
ObservableList
addListener
in interface ObservableList<E>
listener
- the listener for listening to the list changespublic void removeListener(InvalidationListener listener)
ObservableList
removeListener
in interface ObservableList<E>
listener
- a listener to removepublic int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)