Package org.apache.hadoop.hbase.types
Class CopyOnWriteArrayMap.ArrayHolder<K,V>
java.lang.Object
org.apache.hadoop.hbase.types.CopyOnWriteArrayMap.ArrayHolder<K,V>
- Enclosing class:
- CopyOnWriteArrayMap<K,
V>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Comparator<Map.Entry<K,
V>> private final int
private final CopyOnWriteArrayMap.COWEntry<K,
V>[] private final Comparator<? super K>
private final int
-
Constructor Summary
ModifierConstructorDescriptionprivate
ArrayHolder
(Comparator<? super K> keyComparator, Comparator<Map.Entry<K, V>> comparator) private
ArrayHolder
(CopyOnWriteArrayMap.COWEntry[] entries, int startIndex, int endIndex, Comparator<? super K> keyComparator, Comparator<Map.Entry<K, V>> comparator) -
Method Summary
Modifier and TypeMethodDescription(package private) int
Binary search for a given key(package private) int
(package private) CopyOnWriteArrayMap.ArrayHolder<K,
V> insert
(int index, CopyOnWriteArrayMap.COWEntry<K, V> newEntry) (package private) CopyOnWriteArrayMap.ArrayHolder<K,
V> remove
(int index) (package private) CopyOnWriteArrayMap.ArrayHolder<K,
V> replace
(int index, CopyOnWriteArrayMap.COWEntry<K, V> newEntry)
-
Field Details
-
entries
-
startIndex
-
endIndex
-
keyComparator
-
comparator
-
-
Constructor Details
-
ArrayHolder
-
ArrayHolder
private ArrayHolder(CopyOnWriteArrayMap.COWEntry[] entries, int startIndex, int endIndex, Comparator<? super K> keyComparator, Comparator<Map.Entry<K, V>> comparator)
-
-
Method Details
-
getLength
int getLength() -
find
Binary search for a given key- Parameters:
needle
- The key to look for in all of the entries- Returns:
- Same return value as Arrays.binarySearch. Positive numbers mean the index. Otherwise (-1 * insertion point) - 1
-
replace
-
remove
-
insert
-