ShardedMap.CountedMap

A map that can efficiently return the index of a key, and the key at a given index.

Methods
K getKey(long index)
Get the key at the given index.
K getKey(long index)
Get the key at the given index.
Parameters:
index - the index
Returns:
the key
long getKeyIndex(K key)
Get the index of the given key in the map.
long getKeyIndex(K key)
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