java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
javafx.collections.ObservableListBase<E>
javafx.collections.transformation.TransformationList<E,F>
- Type Parameters:
- E- the type parameter of this list
- F- the upper bound of the type of the source list
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- List<E>,- Observable,- ObservableList<E>
- Direct Known Subclasses:
- FilteredList,- SortedList
public abstract class TransformationList<E,F> extends ObservableListBase<E> implements ObservableList<E>
A base class for all lists that wrap another list in a way that changes
 (transforms) the wrapped list's elements, order, size, or structure.
 If the source list is observable, a listener is automatically added to it
 and the events are delegated to 
sourceChanged(javafx.collections.ListChangeListener.Change).- Since:
- JavaFX 8.0
- 
Field SummaryFields declared in class java.util.AbstractListmodCount
- 
Constructor SummaryConstructors Modifier Constructor Description protectedTransformationList(ObservableList<? extends F> source)Creates a new Transformation list wrapped around the source list.
- 
Method SummaryModifier and Type Method Description ObservableList<? extends F>getSource()The source list specified in the constructor of this transformation list.abstract intgetSourceIndex(int index)Maps the index of this list's element to an index in the direct source list.intgetSourceIndexFor(ObservableList<?> list, int index)Maps the index of this list's element to an index of the providedlist.abstract intgetViewIndex(int index)Maps the index of the direct source list's element to an index in this list.booleanisInTransformationChain(ObservableList<?> list)Checks whether the provided list is in the chain under thisTransformationList.protected abstract voidsourceChanged(ListChangeListener.Change<? extends F> c)Called when a change from the source is triggered.Methods declared in class javafx.collections.ObservableListBasebeginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdateMethods declared in class java.util.AbstractListadd, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods declared in class java.util.AbstractCollectionaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toStringMethods declared in class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods declared in interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods declared in interface java.util.Listadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArrayMethods declared in interface javafx.beans.ObservableaddListener, removeListenerMethods declared in interface javafx.collections.ObservableListaddAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
- 
Constructor Details- 
TransformationListCreates a new Transformation list wrapped around the source list.- Parameters:
- source- the wrapped list
 
 
- 
- 
Method Details- 
getSourceThe source list specified in the constructor of this transformation list.- Returns:
- The List that is directly wrapped by this TransformationList
 
- 
isInTransformationChainChecks whether the provided list is in the chain under thisTransformationList. This means the list is either the direct source as returned bygetSource()or the direct source is aTransformationList, and the list is in it's transformation chain.- Parameters:
- list- the list to check
- Returns:
- true if the list is in the transformation chain as specified above.
 
- 
sourceChangedCalled when a change from the source is triggered.- Parameters:
- c- the change
 
- 
getSourceIndexpublic abstract int getSourceIndex(int index)Maps the index of this list's element to an index in the direct source list.- Parameters:
- index- the index in this list
- Returns:
- the index of the element's origin in the source list
- See Also:
- getSource()
 
- 
getSourceIndexForMaps the index of this list's element to an index of the providedlist. Thelistmust be in the transformation chain.- Parameters:
- list- a list from the transformation chain
- index- the index of an element in this list
- Returns:
- the index of the element's origin in the provided list
- See Also:
- isInTransformationChain(javafx.collections.ObservableList)
 
- 
getViewIndexpublic abstract int getViewIndex(int index)Maps the index of the direct source list's element to an index in this list.- Parameters:
- index- the index in the source list
- Returns:
- the index of the element in this list if it is contained in this list or negative value otherwise
- Since:
- 9
- See Also:
- getSource(),- getSourceIndex(int)
 
 
-