Package com.sun.javafx.collections
Interface SortableList<E>
- Type Parameters:
E
-
- All Superinterfaces:
Collection<E>
,Iterable<E>
,List<E>
- All Known Implementing Classes:
ObservableListWrapper
,ObservableSequentialListWrapper
,TrackableObservableList
SortableList is a list that can sort itself in an efficient way, in contrast to the
Collections.sort() method which threat all lists the same way.
E.g. ObservableList can sort and fire only one notification.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
sort()
Sort using default comparatorvoid
sort
(Comparator<? super E> comparator) Sort using comparatorMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, spliterator, subList, toArray, toArray
-
Method Details
-
sort
void sort()Sort using default comparator- Throws:
ClassCastException
- if some of the elements cannot be cast to ComparableUnsupportedOperationException
- if list's iterator doesn't support set
-
sort
Sort using comparator- Specified by:
sort
in interfaceList<E>
- Parameters:
comparator
- the comparator to use- Throws:
ClassCastException
- if the list contains elements that are not mutually comparable using the specified comparator.UnsupportedOperationException
- if the specified list's list-iterator does not support the set operation.
-