java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
javafx.collections.ObservableListBase<E>
javafx.collections.transformation.TransformationList<E,E>
javafx.collections.transformation.SortedList<E>
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- List<E>,- Observable,- ObservableList<E>
public final class SortedList<E> extends TransformationList<E,E>
Wraps an ObservableList and sorts its content.
 All changes in the ObservableList are propagated immediately
 to the SortedList.
 Note: invalid SortedList (as a result of broken comparison) doesn't send any notification to listeners on becoming
 valid again.
- Since:
- JavaFX 8.0
- See Also:
- TransformationList
- 
Property SummaryProperties Type Property Description ObjectProperty<Comparator<? super E>>comparatorThe comparator that denotes the order of this SortedList.
- 
Field SummaryFields declared in class java.util.AbstractListmodCount
- 
Constructor SummaryConstructors Constructor 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.
- 
Method SummaryModifier and Type Method Description ObjectProperty<Comparator<? super E>>comparatorProperty()The comparator that denotes the order of this SortedList.Eget(int index)Returns the element at the specified position in this list.Comparator<? super E>getComparator()Gets the value of the property comparator.voidsetComparator(Comparator<? super E> comparator)Sets the value of the property comparator.intsize()Returns the number of elements in this list.Methods declared in class javafx.collections.transformation.TransformationListgetSource, getSourceIndex, getSourceIndexFor, getViewIndex, isInTransformationChain, sourceChangedMethods 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, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods declared in class java.util.AbstractCollectionaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, 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, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, 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
- 
Property Details- 
comparatorThe comparator that denotes the order of this SortedList. Null for unordered SortedList.- See Also:
- getComparator(),- setComparator(Comparator)
 
 
- 
- 
Constructor Details- 
SortedListCreates a new SortedList wrapped around the source list. The source list will be sorted using the comparator provided. If null is provided, the list stays unordered and is equal to the source list.- Parameters:
- source- a list to wrap
- comparator- a comparator to use or null for unordered List
 
- 
SortedListConstructs a new unordered SortedList wrapper around the source list.- Parameters:
- source- the source list
- See Also:
- SortedList(javafx.collections.ObservableList, java.util.Comparator)
 
 
- 
- 
Method Details- 
comparatorPropertyThe comparator that denotes the order of this SortedList. Null for unordered SortedList.- See Also:
- getComparator(),- setComparator(Comparator)
 
- 
getComparatorGets the value of the property comparator.- Property description:
- The comparator that denotes the order of this SortedList. Null for unordered SortedList.
 
- 
setComparatorSets the value of the property comparator.- Property description:
- The comparator that denotes the order of this SortedList. Null for unordered SortedList.
 
- 
getReturns the element at the specified position in this list.- Specified by:
- getin interface- List<E>
- Specified by:
- getin class- AbstractList<E>
- Parameters:
- index- index of the element to return
- Returns:
- the element at the specified position in this list
- Throws:
- IndexOutOfBoundsException
 
- 
sizepublic int size()Returns the number of elements in this list.- Specified by:
- sizein interface- Collection<E>
- Specified by:
- sizein interface- List<E>
- Specified by:
- sizein class- AbstractCollection<E>
- Returns:
- the number of elements in this list
 
 
-