public class ObservableListWrapper<E> extends ModifiableObservableListBase<E> implements ObservableList<E>, SortableList<E>, java.util.RandomAccess
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<E> |
backingList |
private ElementObserver |
elementObserver |
private SortHelper |
helper |
| Constructor and Description |
|---|
ObservableListWrapper(java.util.List<E> list) |
ObservableListWrapper(java.util.List<E> list,
Callback<E,Observable[]> extractor) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
protected void |
doAdd(int index,
E element)
Adds the
element to the List at the position of index. |
protected E |
doRemove(int index)
Removes the element at position of
index. |
protected E |
doSet(int index,
E element)
Sets the
element in the List at the position of index. |
E |
get(int index) |
private SortHelper |
getSortHelper() |
int |
indexOf(java.lang.Object o) |
int |
lastIndexOf(java.lang.Object o) |
void |
remove(int fromIndex,
int toIndex)
Basically a shortcut to sublist(from, to).clear()
As this is a common operation, ObservableList has this method for convenient usage.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
void |
sort()
Sort using default comparator
|
void |
sort(java.util.Comparator<? super E> comparator)
Sort using comparator
|
add, addAll, addAll, remove, remove, removeRange, set, setAll, subListaddAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, removeAll, removeListener, removeListener, retainAll, setAlladd, equals, hashCode, iterator, listIterator, listIteratorclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, addListener, filtered, removeAll, removeListener, retainAll, setAll, setAll, sorted, sortedaddListener, removeListenerprivate final java.util.List<E> backingList
private final ElementObserver elementObserver
private SortHelper helper
public ObservableListWrapper(java.util.List<E> list)
public ObservableListWrapper(java.util.List<E> list, Callback<E,Observable[]> extractor)
public E get(int index)
get in interface java.util.List<E>get in class ModifiableObservableListBase<E>public int size()
size in interface java.util.Collection<E>size in interface java.util.List<E>size in class ModifiableObservableListBase<E>protected void doAdd(int index,
E element)
ModifiableObservableListBaseelement to the List at the position of index.
For the description of possible exceptions, please refer to the documentation
of AbstractList.add(java.lang.Object) method.
doAdd in class ModifiableObservableListBase<E>index - the position where to add the elementelement - the element that will be addedprotected E doSet(int index, E element)
ModifiableObservableListBaseelement in the List at the position of index.
For the description of possible exceptions, please refer to the documentation
of ModifiableObservableListBase.set(int, java.lang.Object) method.
doSet in class ModifiableObservableListBase<E>index - the position where to set the elementelement - the element that will be set at the specified positionprotected E doRemove(int index)
ModifiableObservableListBaseindex.doRemove in class ModifiableObservableListBase<E>index - the index of the removed elementpublic int indexOf(java.lang.Object o)
public int lastIndexOf(java.lang.Object o)
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public void clear()
public void remove(int fromIndex,
int toIndex)
ObservableListremove in interface ObservableList<E>remove in class ObservableListBase<E>fromIndex - the start of the range to remove (inclusive)toIndex - the end of the range to remove (exclusive)public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>removeAll in class ModifiableObservableListBase<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>retainAll in class ModifiableObservableListBase<E>public void sort()
SortableListsort in interface SortableList<E>public void sort(java.util.Comparator<? super E> comparator)
SortableListsort in interface SortableList<E>sort in interface java.util.List<E>comparator - the comparator to useprivate SortHelper getSortHelper()