Class ArraySortedSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
com.linkedin.alpini.base.concurrency.ArraySortedSet<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
Cloneable
,Iterable<E>
,Collection<E>
,Set<E>
,SortedSet<E>
A thread-safe
SortedSet
implementation which uses an array as a backing store.
Mutations to the backing store are guarded by a read-write lock.
The purpose of this is to be a more garbage-collector friendly collection than ConcurrentSkipListSet at the cost
of slightly more CPU cost at insert and deletion.
When used as a backing store for AbstractQuantileEstimation, 5 million samples per second can be performed at the
average invocation time of 3 microseconds.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) void
clear()
clone()
Comparator<? super E>
boolean
boolean
containsAll
(Collection<?> c) boolean
first()
void
int
hashCode()
boolean
isEmpty()
iterator()
last()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.util.AbstractCollection
toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
ArraySortedSet
-
-
Method Details
-
clone
-
iterator
-
forEach
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceSet<E>
- Specified by:
size
in classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
- Specified by:
isEmpty
in interfaceSet<E>
- Overrides:
isEmpty
in classAbstractCollection<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceSet<E>
- Overrides:
contains
in classAbstractCollection<E>
-
toArray
- Specified by:
toArray
in interfaceCollection<E>
- Specified by:
toArray
in interfaceSet<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
toArray
@Nonnull public <T> T[] toArray(@Nonnull T[] a) - Specified by:
toArray
in interfaceCollection<E>
- Specified by:
toArray
in interfaceSet<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
add
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceSet<E>
- Overrides:
add
in classAbstractCollection<E>
-
remove
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceSet<E>
- Overrides:
remove
in classAbstractCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
- Overrides:
containsAll
in classAbstractCollection<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Specified by:
addAll
in interfaceSet<E>
- Overrides:
addAll
in classAbstractCollection<E>
-
comparator
- Specified by:
comparator
in interfaceSortedSet<E>
-
subSet
-
headSet
-
tailSet
-
first
-
last
-
spliterator
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
- Specified by:
spliterator
in interfaceSet<E>
- Specified by:
spliterator
in interfaceSortedSet<E>
-
equals
- Specified by:
equals
in interfaceCollection<E>
- Specified by:
equals
in interfaceSet<E>
- Overrides:
equals
in classAbstractSet<E>
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<E>
- Specified by:
hashCode
in interfaceSet<E>
- Overrides:
hashCode
in classAbstractSet<E>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceSet<E>
- Overrides:
removeAll
in classAbstractSet<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Specified by:
retainAll
in interfaceSet<E>
- Overrides:
retainAll
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceSet<E>
- Overrides:
clear
in classAbstractCollection<E>
-
floor
-