Package com.sun.javafx.collections
Class ObservableListWrapper<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
javafx.collections.ObservableListBase<E>
javafx.collections.ModifiableObservableListBase<E>
com.sun.javafx.collections.ObservableListWrapper<E>
- All Implemented Interfaces:
SortableList<E>,Iterable<E>,Collection<E>,List<E>,RandomAccess,Observable,ObservableList<E>
- Direct Known Subclasses:
TrackableObservableList
public class ObservableListWrapper<E>
extends ModifiableObservableListBase<E>
implements ObservableList<E>, SortableList<E>, RandomAccess
A List wrapper class that implements observability.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionObservableListWrapper(List<E> list) ObservableListWrapper(List<E> list, Callback<E, Observable[]> extractor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanbooleancontainsAll(Collection<?> c) protected voidAdds theelementto the List at the position ofindex.protected EdoRemove(int index) Removes the element at position ofindex.protected ESets theelementin the List at the position ofindex.get(int index) intintvoidremove(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.booleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()voidsort()Sort using default comparatorvoidsort(Comparator<? super E> comparator) Sort using comparatorMethods inherited from class javafx.collections.ModifiableObservableListBase
add, addAll, addAll, remove, remove, removeRange, set, setAll, subListMethods inherited from class javafx.collections.ObservableListBase
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, removeAll, removeListener, removeListener, retainAll, setAllMethods inherited from class java.util.AbstractList
add, equals, hashCode, iterator, listIterator, listIteratorMethods inherited from class java.util.AbstractCollection
isEmpty, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.List
add, add, addAll, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, replaceAll, set, spliterator, subList, toArray, toArrayMethods inherited from interface javafx.beans.Observable
addListener, removeListenerMethods inherited from interface javafx.collections.ObservableList
addAll, addListener, filtered, removeAll, removeListener, retainAll, setAll, setAll, sorted
-
Constructor Details
-
ObservableListWrapper
-
ObservableListWrapper
-
-
Method Details
-
get
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classModifiableObservableListBase<E>
-
doAdd
Description copied from class:ModifiableObservableListBaseAdds theelementto the List at the position ofindex.For the description of possible exceptions, please refer to the documentation of
AbstractList.add(java.lang.Object)method.- Specified by:
doAddin classModifiableObservableListBase<E>- Parameters:
index- the position where to add the elementelement- the element that will be added
-
doSet
Description copied from class:ModifiableObservableListBaseSets theelementin the List at the position ofindex.For the description of possible exceptions, please refer to the documentation of
ModifiableObservableListBase.set(int, java.lang.Object)method.- Specified by:
doSetin classModifiableObservableListBase<E>- Parameters:
index- the position where to set the elementelement- the element that will be set at the specified position- Returns:
- the old element at the specified position
-
doRemove
Description copied from class:ModifiableObservableListBaseRemoves the element at position ofindex.- Specified by:
doRemovein classModifiableObservableListBase<E>- Parameters:
index- the index of the removed element- Returns:
- the removed element
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>- Overrides:
lastIndexOfin classAbstractList<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Overrides:
containsin classAbstractCollection<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- Overrides:
containsAllin classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-
remove
public void remove(int fromIndex, int toIndex) Description copied from interface:ObservableListBasically a shortcut to sublist(from, to).clear() As this is a common operation, ObservableList has this method for convenient usage.- Specified by:
removein interfaceObservableList<E>- Overrides:
removein classObservableListBase<E>- Parameters:
fromIndex- the start of the range to remove (inclusive)toIndex- the end of the range to remove (exclusive)
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceList<E>- Overrides:
removeAllin classModifiableObservableListBase<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceList<E>- Overrides:
retainAllin classModifiableObservableListBase<E>
-
sort
public void sort()Description copied from interface:SortableListSort using default comparator- Specified by:
sortin interfaceSortableList<E>
-
sort
Description copied from interface:SortableListSort using comparator
-