E
- public interface SortableList<E> extends List<E>
Modifier and Type | Method and Description |
---|---|
void |
sort()
Sort using default comparator
|
void |
sort(Comparator<? super E> comparator)
Sort using comparator
|
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
parallelStream, removeIf, stream
void sort()
ClassCastException
- if some of the elements cannot be cast to ComparableUnsupportedOperationException
- if list's iterator doesn't support setvoid sort(Comparator<? super E> comparator)
sort
in interface List<E>
comparator
- the comparator to useClassCastException
- 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.Copyright © 2020. All rights reserved.