Package tools.refinery.store.query.utils
Class OrderStatisticTree<T extends Comparable<? super T>>
java.lang.Object
tools.refinery.store.query.utils.OrderStatisticTree<T>
- Type Parameters:
T
- the actual element type.
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Set<T>
This class implements an order statistic tree which is based on AVL-trees.
This class was copied into Refinery from https://github.com/coderodde/OrderStatisticTree and is available under the MIT License. We also incorporated changes by Eugene Schava and cleaned up some linter warnings.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) get
(int index) int
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<U> U[]
toArray
(U[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
OrderStatisticTree
public OrderStatisticTree()
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
iterator
in interfaceIterable<T extends Comparable<? super T>>
- Specified by:
iterator
in interfaceSet<T extends Comparable<? super T>>
-
toArray
- Specified by:
toArray
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
toArray
in interfaceSet<T extends Comparable<? super T>>
-
toArray
public <U> U[] toArray(U[] a) - Specified by:
toArray
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
toArray
in interfaceSet<T extends Comparable<? super T>>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
containsAll
in interfaceSet<T extends Comparable<? super T>>
-
addAll
- Specified by:
addAll
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
addAll
in interfaceSet<T extends Comparable<? super T>>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
retainAll
in interfaceSet<T extends Comparable<? super T>>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
removeAll
in interfaceSet<T extends Comparable<? super T>>
-
add
- Specified by:
add
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
add
in interfaceSet<T extends Comparable<? super T>>
-
contains
- Specified by:
contains
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
contains
in interfaceSet<T extends Comparable<? super T>>
-
remove
- Specified by:
remove
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
remove
in interfaceSet<T extends Comparable<? super T>>
-
get
-
indexOf
-
size
public int size()- Specified by:
size
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
size
in interfaceSet<T extends Comparable<? super T>>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
isEmpty
in interfaceSet<T extends Comparable<? super T>>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
clear
in interfaceSet<T extends Comparable<? super T>>
-