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
ConstructorDescriptionObservableListWrapper
(List<E> list) ObservableListWrapper
(List<E> list, Callback<E, Observable[]> extractor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
boolean
containsAll
(Collection<?> c) protected void
Adds theelement
to the List at the position ofindex
.protected E
doRemove
(int index) Removes the element at position ofindex
.protected E
Sets theelement
in the List at the position ofindex
.get
(int index) int
int
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 comparatorvoid
sort
(Comparator<? super E> comparator) Sort using comparatorMethods inherited from class javafx.collections.ModifiableObservableListBase
add, addAll, addAll, remove, remove, removeRange, set, setAll, subList
Methods inherited from class javafx.collections.ObservableListBase
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, removeAll, removeListener, removeListener, retainAll, setAll
Methods inherited from class java.util.AbstractList
add, equals, hashCode, iterator, listIterator, listIterator
Methods inherited from class java.util.AbstractCollection
isEmpty, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.List
add, add, addAll, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, replaceAll, set, spliterator, subList, toArray, toArray
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
Methods 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:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classModifiableObservableListBase<E>
-
doAdd
Description copied from class:ModifiableObservableListBase
Adds theelement
to 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:
doAdd
in classModifiableObservableListBase<E>
- Parameters:
index
- the position where to add the elementelement
- the element that will be added
-
doSet
Description copied from class:ModifiableObservableListBase
Sets theelement
in 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:
doSet
in 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:ModifiableObservableListBase
Removes the element at position ofindex
.- Specified by:
doRemove
in classModifiableObservableListBase<E>
- Parameters:
index
- the index of the removed element- Returns:
- the removed element
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<E>
- Overrides:
lastIndexOf
in classAbstractList<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceList<E>
- Overrides:
contains
in classAbstractCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
- Overrides:
containsAll
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
- Overrides:
clear
in classAbstractList<E>
-
remove
public void remove(int fromIndex, int toIndex) Description copied from interface:ObservableList
Basically a shortcut to sublist(from, to).clear() As this is a common operation, ObservableList has this method for convenient usage.- Specified by:
remove
in interfaceObservableList<E>
- Overrides:
remove
in classObservableListBase<E>
- Parameters:
fromIndex
- the start of the range to remove (inclusive)toIndex
- the end of the range to remove (exclusive)
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceList<E>
- Overrides:
removeAll
in classModifiableObservableListBase<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Specified by:
retainAll
in interfaceList<E>
- Overrides:
retainAll
in classModifiableObservableListBase<E>
-
sort
public void sort()Description copied from interface:SortableList
Sort using default comparator- Specified by:
sort
in interfaceSortableList<E>
-
sort
Description copied from interface:SortableList
Sort using comparator
-