E
- The type of the List
public class ImplicitSortedList<E> extends ArrayList<E>
List
(no insertion order)
If no comparator is provided and no elements within the list implement
Comparable
, then the list is sorted by order of their hashcodes
Due to the nature of determining comparability, this list type should almost never
be rawtyped without an explicit comparatormodCount
Constructor and Description |
---|
ImplicitSortedList() |
ImplicitSortedList(Collection<? extends E> collection) |
ImplicitSortedList(Collection<? extends E> collection,
Comparator<? super E> comparator) |
ImplicitSortedList(Comparator<? super E> comparator) |
ImplicitSortedList(int capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index,
Collection<? extends E> c) |
void |
replaceAll(UnaryOperator<E> operator) |
E |
set(int index,
E element) |
protected void |
sort() |
void |
sort(Comparator<? super E> c) |
ImplicitSortedList<E> |
subList(int fromIndex,
int toIndex) |
clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, retainAll, size, spliterator, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public ImplicitSortedList()
public ImplicitSortedList(int capacity)
public ImplicitSortedList(Comparator<? super E> comparator)
public ImplicitSortedList(Collection<? extends E> collection)
public ImplicitSortedList(Collection<? extends E> collection, Comparator<? super E> comparator)
protected final void sort()
public void sort(Comparator<? super E> c)
public boolean add(E e)
public void add(int index, E element)
public boolean addAll(Collection<? extends E> c)
public boolean addAll(int index, Collection<? extends E> c)
public ImplicitSortedList<E> subList(int fromIndex, int toIndex)
public void replaceAll(UnaryOperator<E> operator)
replaceAll
in interface List<E>
replaceAll
in class ArrayList<E>
Copyright © 2017. All rights reserved.