E - type of elements in this setpublic class UnmodifiableSortedSet<E> extends ArraySet<E> implements SortedSet<E>
ArraySet.SetFullException_entries, MAX_CAPACITY| Constructor and Description |
|---|
UnmodifiableSortedSet(Collection<? extends E> c)
Warning: O(n**2)
|
UnmodifiableSortedSet(Collection<? extends E> c,
Comparator<? super E> comparator)
Warning: O(n**2)
|
UnmodifiableSortedSet(Set<? extends E> c) |
UnmodifiableSortedSet(Set<? extends E> c,
Comparator<? super E> comparator) |
UnmodifiableSortedSet(SortedSet<? extends E> c) |
UnmodifiableSortedSet(SortedSet<? extends E> c,
Comparator<? super E> comparator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
void |
addUnique(E o)
Unconditionally add o to the set.
|
void |
clear() |
Comparator<? super E> |
comparator() |
E |
first() |
SortedSet<E> |
headSet(E toElement) |
protected int |
indexOf(Object o)
Overridden to do binary search
|
E |
last() |
boolean |
remove(Object o) |
SortedSet<E> |
subSet(E fromElement,
E toElement) |
SortedSet<E> |
tailSet(E fromElement) |
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitspliteratoraddAll, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArrayparallelStream, removeIf, streampublic UnmodifiableSortedSet(Collection<? extends E> c)
public UnmodifiableSortedSet(Collection<? extends E> c, Comparator<? super E> comparator)
public UnmodifiableSortedSet(Set<? extends E> c, Comparator<? super E> comparator)
public UnmodifiableSortedSet(SortedSet<? extends E> c, Comparator<? super E> comparator)
public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class ArraySet<E>o - the element to addUnsupportedOperationExceptionpublic void addUnique(E o)
ArraySetaddUnique in class ArraySet<E>o - non-null, NPE will not be thrownUnsupportedOperationExceptionpublic void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class ArraySet<E>UnsupportedOperationExceptionpublic Comparator<? super E> comparator()
comparator in interface SortedSet<E>public SortedSet<E> headSet(E toElement)
headSet in interface SortedSet<E>UnsupportedOperationExceptionprotected int indexOf(Object o)
public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class ArraySet<E>UnsupportedOperationExceptionpublic SortedSet<E> subSet(E fromElement, E toElement)
subSet in interface SortedSet<E>UnsupportedOperationException