public final class SortedList<E> extends TransformationList<E,E>
TransformationList
Type | Property and Description |
---|---|
ObjectProperty<java.util.Comparator<? super E>> |
comparator
The comparator that denotes the order of this SortedList.
|
Constructor and Description |
---|
SortedList(ObservableList<? extends E> source)
Constructs a new unordered SortedList wrapper around the source list.
|
SortedList(ObservableList<? extends E> source,
java.util.Comparator<? super E> comparator)
Creates a new SortedList wrapped around the source list.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<java.util.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.
|
java.util.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(java.util.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, isInTransformationChain
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll, setAll
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
addListener, removeListener
public final ObjectProperty<java.util.Comparator<? super E>> comparatorProperty
getComparator()
,
setComparator(Comparator)
public SortedList(ObservableList<? extends E> source, java.util.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)
TransformationList
sourceChanged
in class TransformationList<E,E>
c
- the changepublic final ObjectProperty<java.util.Comparator<? super E>> comparatorProperty()
getComparator()
,
setComparator(Comparator)
public final java.util.Comparator<? super E> getComparator()
public final void setComparator(java.util.Comparator<? super E> comparator)
public E get(int index)
public int size()
public int getSourceIndex(int index)
TransformationList
getSourceIndex
in class TransformationList<E,E>
index
- the index in this listTransformationList.getSource()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2024, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.