public interface Collection<T> extends Iterable<T>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all elements from the collection.
|
Comparator<T> |
getComparator()
Returns the collection's sort order.
|
boolean |
isEmpty()
Tests the emptiness of the collection.
|
void |
setComparator(Comparator<T> comparator)
Sets the collection's sort order, re-ordering the collection's contents
and ensuring that new entries preserve the sort order.
|
void clear()
boolean isEmpty()
Comparator<T> getComparator()
setComparator(Comparator)
void setComparator(Comparator<T> comparator)
Calling this method more than once with the same comparator will re-sort the collection.
comparator
- The comparator used to order elements in the collection, or null if the
collection is unsorted.