public class BisectionSet<A> extends AbstractSet<A> implements SortedSet<A>
Modifier and Type | Field and Description |
---|---|
protected Comparator<? super A> |
comparator |
protected List<? extends A> |
elems |
protected int |
length |
protected int |
offset |
Modifier | Constructor and Description |
---|---|
protected |
BisectionSet(Comparator<? super A> comparator,
List<? extends A> elems,
int offset,
int length) |
|
BisectionSet(SortedList<A> elems) |
Modifier and Type | Method and Description |
---|---|
protected int |
bisect(A a) |
Comparator<? super A> |
comparator() |
boolean |
contains(Object a) |
A |
first() |
BisectionSet<A> |
headSet(A a) |
Iterator<A> |
iterator() |
A |
last() |
protected BisectionSet<A> |
shift(int offset,
int length) |
int |
size() |
BisectionSet<A> |
subSet(A a,
A b) |
BisectionSet<A> |
tailSet(A a) |
equals, hashCode, removeAll
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
add, addAll, clear, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
parallelStream, removeIf, stream
protected final Comparator<? super A> comparator
protected final int offset
protected final int length
public BisectionSet(SortedList<A> elems)
protected BisectionSet(Comparator<? super A> comparator, List<? extends A> elems, int offset, int length)
public int size()
size
in interface Collection<A>
size
in interface Set<A>
size
in class AbstractCollection<A>
public boolean contains(Object a)
contains
in interface Collection<A>
contains
in interface Set<A>
contains
in class AbstractCollection<A>
public Comparator<? super A> comparator()
comparator
in interface SortedSet<A>
protected int bisect(A a)
protected BisectionSet<A> shift(int offset, int length)
see also the complete user documentation .