public final class SortedList<E> extends TransformationList<E,E>
TransformationList| Type | Property and Description |
|---|---|
ObjectProperty<Comparator<? super E>> |
comparator
The comparator that denotes the order of this SortedList.
|
modCount| Constructor and Description |
|---|
SortedList(ObservableList<? extends E> source)
Constructs a new unordered SortedList wrapper around the source list.
|
SortedList(ObservableList<? extends E> source,
Comparator<? super E> comparator)
Creates a new SortedList wrapped around the source list.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectProperty<Comparator<? super E>> |
comparatorProperty()
The comparator that denotes the order of this SortedList.
|
E |
get(int index)
Returns the element at the specified position in this list.
|
Comparator<? super E> |
getComparator()
Gets the value of the property comparator.
|
int |
getSourceIndex(int index)
Maps the index of this list's element to an index in the direct source list.
|
void |
setComparator(Comparator<? super E> comparator)
Sets the value of the property comparator.
|
int |
size()
Returns the number of elements in this list.
|
protected void |
sourceChanged(ListChangeListener.Change<? extends E> c)
Called when a change from the source is triggered.
|
getSource, getSourceIndexFor, isInTransformationChainaddAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll, setAlladd, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sortedadd, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streamaddListener, removeListenerpublic final ObjectProperty<Comparator<? super E>> comparatorProperty
getComparator(),
setComparator(Comparator)public SortedList(ObservableList<? extends E> source, Comparator<? super E> comparator)
source - a list to wrapcomparator - a comparator to use or null for unordered Listpublic SortedList(ObservableList<? extends E> source)
source - the source listSortedList(javafx.collections.ObservableList, java.util.Comparator)protected void sourceChanged(ListChangeListener.Change<? extends E> c)
TransformationListsourceChanged in class TransformationList<E,E>c - the changepublic final ObjectProperty<Comparator<? super E>> comparatorProperty()
getComparator(),
setComparator(Comparator)public final Comparator<? super E> getComparator()
public final void setComparator(Comparator<? super E> comparator)
public E get(int index)
get in interface List<E>get in class AbstractList<E>index - index of the element to returnIndexOutOfBoundsExceptionpublic int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public int getSourceIndex(int index)
TransformationListgetSourceIndex in class TransformationList<E,E>index - the index in this listTransformationList.getSource()Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.