Package org.h2.dev.cluster
Interface ShardedMap.CountedMap<K,V>
- Enclosing class:
ShardedMap<K,V>
public static interface ShardedMap.CountedMap<K,V>
A map that can efficiently return the index of a key, and the key at a
given index.
-
Method Summary
Modifier and TypeMethodDescriptiongetKey(long index) Get the key at the given index.longgetKeyIndex(K key) Get the index of the given key in the map.
-
Method Details
-
getKey
Get the key at the given index.- Parameters:
index- the index- Returns:
- the key
-
getKeyIndex
Get the index of the given key in the map.If the key was found, the returned value is the index in the key array. If not found, the returned value is negative, where -1 means the provided key is smaller than any keys. See also Arrays.binarySearch.
- Parameters:
key- the key- Returns:
- the index
-