public 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, removeAll
addAll, containsAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
parallelStream, removeIf, stream
public UnmodifiableSortedSet(SortedSet<? extends E> c, Comparator<? super E> comparator)
public UnmodifiableSortedSet(Set<? extends E> c, Comparator<? super E> comparator)
public UnmodifiableSortedSet(Collection<? extends E> c)
public UnmodifiableSortedSet(Collection<? extends E> c, Comparator<? super E> comparator)
public Comparator<? super E> comparator()
comparator
in interface SortedSet<E>
public SortedSet<E> headSet(E toElement)
headSet
in interface SortedSet<E>
UnsupportedOperationException
public SortedSet<E> subSet(E fromElement, E toElement)
subSet
in interface SortedSet<E>
UnsupportedOperationException
public SortedSet<E> tailSet(E fromElement)
tailSet
in interface SortedSet<E>
UnsupportedOperationException
public boolean add(E o)
add
in interface Collection<E>
add
in interface Set<E>
add
in class ArraySet<E>
UnsupportedOperationException
public void addUnique(E o)
ArraySet
addUnique
in class ArraySet<E>
o
- non-null, NPE will not be thrownUnsupportedOperationException
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class ArraySet<E>
UnsupportedOperationException
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class ArraySet<E>
UnsupportedOperationException