public class ObservableListWrapper<E> extends ModifiableObservableListBase<E> implements ObservableList<E>, SortableList<E>, RandomAccess
modCount
Constructor and Description |
---|
ObservableListWrapper(List<E> list) |
ObservableListWrapper(List<E> list,
Callback<E,Observable[]> extractor) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(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) |
int |
indexOf(Object o) |
int |
lastIndexOf(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(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
void |
sort()
Sort using default comparator
|
void |
sort(Comparator<? super E> comparator)
Sort using comparator
|
add, addAll, addAll, remove, remove, removeRange, set, setAll, subList
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, removeAll, removeListener, removeListener, retainAll, setAll
add, equals, hashCode, iterator, listIterator, listIterator
isEmpty, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addListener, filtered, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
addListener, removeListener
add, add, addAll, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, replaceAll, set, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
public ObservableListWrapper(List<E> list, Callback<E,Observable[]> extractor)
public E get(int index)
public int size()
size
in interface Collection<E>
size
in interface 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 int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf
in interface List<E>
lastIndexOf
in class AbstractList<E>
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in interface List<E>
contains
in class AbstractCollection<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
containsAll
in class AbstractCollection<E>
public void clear()
clear
in interface Collection<E>
clear
in interface List<E>
clear
in class AbstractList<E>
public void remove(int fromIndex, int toIndex)
ObservableList
remove
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(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface List<E>
removeAll
in class ModifiableObservableListBase<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface List<E>
retainAll
in class ModifiableObservableListBase<E>
public void sort()
SortableList
sort
in interface SortableList<E>
public void sort(Comparator<? super E> comparator)
SortableList
Copyright © 2020. All rights reserved.