public final class ObservableSequentialListWrapper<E> extends ModifiableObservableListBase<E> implements ObservableList<E>, SortableList<E>
Modifier and Type | Field and Description |
---|---|
private java.util.List<E> |
backingList |
private ElementObserver |
elementObserver |
private SortHelper |
helper |
Constructor and Description |
---|
ObservableSequentialListWrapper(java.util.List<E> list) |
ObservableSequentialListWrapper(java.util.List<E> list,
Callback<E,Observable[]> extractor) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(int index,
java.util.Collection<? extends E> c) |
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) |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<E> |
listIterator(int index) |
int |
size() |
void |
sort()
Sort using default comparator
|
void |
sort(java.util.Comparator<? super E> comparator)
Sort using comparator
|
add, addAll, remove, remove, removeAll, removeRange, retainAll, set, setAll, subList
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
addListener, removeListener
private final java.util.List<E> backingList
private final ElementObserver elementObserver
private SortHelper helper
public ObservableSequentialListWrapper(java.util.List<E> list)
public ObservableSequentialListWrapper(java.util.List<E> list, Callback<E,Observable[]> extractor)
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public int indexOf(java.lang.Object o)
public int lastIndexOf(java.lang.Object o)
public java.util.ListIterator<E> listIterator(int index)
public java.util.Iterator<E> iterator()
public E get(int index)
get
in interface java.util.List<E>
get
in class ModifiableObservableListBase<E>
public boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
addAll
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)
ModifiableObservableListBase
element
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)
ModifiableObservableListBase
element
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)
ModifiableObservableListBase
index
.doRemove
in class ModifiableObservableListBase<E>
index
- the index of the removed elementpublic void sort()
SortableList
sort
in interface SortableList<E>
public void sort(java.util.Comparator<? super E> comparator)
SortableList
sort
in interface SortableList<E>
sort
in interface java.util.List<E>
comparator
- the comparator to useprivate SortHelper getSortHelper()