Package org.apache.cassandra.utils
Class InsertionOrderedNavigableSet<E>
- java.lang.Object
-
- org.apache.cassandra.utils.InsertionOrderedNavigableSet<E>
-
- Type Parameters:
E
- the type of elements maintained by this set
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.NavigableSet<E>
,java.util.Set<E>
,java.util.SortedSet<E>
public class InsertionOrderedNavigableSet<E> extends java.lang.Object implements java.util.NavigableSet<E>
ANavigableSet
that enforces in-order insertion of elements. This is helpful when we have an already-ordered collection with no duplicates and want constant time insertion.Note: Not all methods of
NavigableSet
are implemented.
-
-
Constructor Summary
Constructors Constructor Description InsertionOrderedNavigableSet(java.util.Comparator<? super E> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
E
ceiling(E e)
void
clear()
java.util.Comparator<? super E>
comparator()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
java.util.Iterator<E>
descendingIterator()
java.util.NavigableSet<E>
descendingSet()
boolean
equals(java.lang.Object o)
E
first()
E
floor(E e)
int
hashCode()
java.util.SortedSet<E>
headSet(E toElement)
java.util.NavigableSet<E>
headSet(E toElement, boolean inclusive)
E
higher(E e)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
E
last()
E
lower(E e)
E
pollFirst()
E
pollLast()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.util.NavigableSet<E>
subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
java.util.SortedSet<E>
subSet(E fromElement, E toElement)
java.util.SortedSet<E>
tailSet(E fromElement)
java.util.NavigableSet<E>
tailSet(E fromElement, boolean inclusive)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
-
-
Constructor Detail
-
InsertionOrderedNavigableSet
public InsertionOrderedNavigableSet(java.util.Comparator<? super E> comparator)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
clear
public void clear()
-
descendingSet
public java.util.NavigableSet<E> descendingSet()
- Specified by:
descendingSet
in interfacejava.util.NavigableSet<E>
-
descendingIterator
public java.util.Iterator<E> descendingIterator()
- Specified by:
descendingIterator
in interfacejava.util.NavigableSet<E>
-
subSet
public java.util.NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSet
in interfacejava.util.NavigableSet<E>
-
headSet
public java.util.NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSet
in interfacejava.util.NavigableSet<E>
-
tailSet
public java.util.NavigableSet<E> tailSet(E fromElement, boolean inclusive)
- Specified by:
tailSet
in interfacejava.util.NavigableSet<E>
-
comparator
public java.util.Comparator<? super E> comparator()
- Specified by:
comparator
in interfacejava.util.SortedSet<E>
-
equals
public boolean equals(java.lang.Object o)
-
-