public abstract class ReadOnlyUnbackedObservableList<E> extends java.lang.Object implements ObservableList<E>
Modifier and Type | Class and Description |
---|---|
private static class |
ReadOnlyUnbackedObservableList.SelectionListIterator<E> |
Modifier and Type | Field and Description |
---|---|
private ListListenerHelper<E> |
listenerHelper |
Constructor and Description |
---|
ReadOnlyUnbackedObservableList() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> c) |
boolean |
addAll(E... elements)
A convenient method for var-arg adding of elements.
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c) |
void |
addListener(InvalidationListener listener)
Adds an
InvalidationListener which will be notified whenever the
Observable becomes invalid. |
void |
addListener(ListChangeListener<? super E> obs)
Add a listener to this observable list.
|
void |
callObservers(ListChangeListener.Change<E> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
abstract E |
get(int i) |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int index) |
E |
remove(int index) |
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 o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(E... elements)
A convenient method for var-arg usage of removaAll method.
|
void |
removeListener(InvalidationListener listener)
Removes the given listener from the list of listeners, that are notified
whenever the value of the
Observable becomes invalid. |
void |
removeListener(ListChangeListener<? super E> obs)
Tries to removed a listener from this observable list.
|
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(E... elements)
A convenient method for var-arg usage of retain method.
|
E |
set(int index,
E element) |
boolean |
setAll(java.util.Collection<? extends E> col)
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.
|
abstract int |
size() |
java.util.List<E> |
subList(int fromIndex,
int toIndex)
NOTE: This method does not fulfill the subList contract from Collections,
it simply returns a list containing the values in the given range.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
filtered, sorted, sorted
private ListListenerHelper<E> listenerHelper
public abstract int size()
public void addListener(InvalidationListener listener)
Observable
InvalidationListener
which will be notified whenever the
Observable
becomes invalid. If the same
listener is added more than once, then it will be notified more than
once. That is, no check is made to ensure uniqueness.
Note that the same actual InvalidationListener
instance may be
safely registered for different Observables
.
The Observable
stores a strong reference to the listener
which will prevent the listener from being garbage collected and may
result in a memory leak. It is recommended to either unregister a
listener by calling removeListener
after use or to use an instance of
WeakInvalidationListener
avoid this situation.
addListener
in interface Observable
listener
- The listener to registerObservable.removeListener(InvalidationListener)
public void removeListener(InvalidationListener listener)
Observable
Observable
becomes invalid.
If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
removeListener
in interface Observable
listener
- The listener to removeObservable.addListener(InvalidationListener)
public void addListener(ListChangeListener<? super E> obs)
ObservableList
addListener
in interface ObservableList<E>
obs
- the listener for listening to the list changespublic void removeListener(ListChangeListener<? super E> obs)
ObservableList
removeListener
in interface ObservableList<E>
obs
- a listener to removepublic void callObservers(ListChangeListener.Change<E> c)
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<E>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<E>
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean isEmpty()
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
public java.util.Iterator<E> iterator()
public java.util.List<E> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<E>
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean add(E e)
public boolean addAll(java.util.Collection<? extends E> c)
public boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
public boolean addAll(E... elements)
ObservableList
addAll
in interface ObservableList<E>
elements
- the elements to addpublic 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 setAll(E... elements)
ObservableList
setAll
in interface ObservableList<E>
elements
- the elements to setpublic void clear()
public boolean remove(java.lang.Object o)
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public void remove(int from, int to)
ObservableList
remove
in interface ObservableList<E>
from
- the start of the range to remove (inclusive)to
- the end of the range to remove (exclusive)public boolean removeAll(E... elements)
ObservableList
removeAll
in interface ObservableList<E>
elements
- the elements to be removedpublic boolean retainAll(E... elements)
ObservableList
retainAll
in interface ObservableList<E>
elements
- the elements to be retained