Package com.macrofocus.utils
Interface IndexedNavigableMap<K,V>
- All Superinterfaces:
Map<K,
,V> NavigableMap<K,
,V> SortedMap<K,
V>
- All Known Implementing Classes:
IndexedTreeMap
User: Vitaly Sazanovich
Date: 07/02/13
Time: 19:28
Email: Vitaly.Sazanovich@gmail.com
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionexactEntry
(int index) Returns a key-value mapping associated with the key located at the index offset from the beginning of the sorted mapexactKey
(int index) Returns the key located at the index offset from the beginning of the sorted mapint
Searches the specified tree map for the specified key using the put algorithm.Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Methods inherited from interface java.util.NavigableMap
ceilingEntry, ceilingKey, descendingKeySet, descendingMap, firstEntry, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, lastEntry, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, subMap, subMap, tailMap, tailMap
-
Method Details
-
exactKey
Returns the key located at the index offset from the beginning of the sorted map- Parameters:
index
- index of the key- Returns:
- the key
key
located at the index (@code index) offset from the beginning of the sorted map - Throws:
ArrayIndexOutOfBoundsException
- if the specified index is less than 0 or greater than size-1
-
exactEntry
Returns a key-value mapping associated with the key located at the index offset from the beginning of the sorted map- Parameters:
index
- index of the key- Returns:
- the entry with the key
key
located at the index (@code index) offset from the beginning of the sorted map - Throws:
ArrayIndexOutOfBoundsException
- if the specified index is less than 0 or greater than size-1
-
keyIndex
Searches the specified tree map for the specified key using the put algorithm. Calculates its offset from the beginning of the sorted map using weights.- Parameters:
k
- the key- Returns:
- index of the search key, if it is contained in the tree map; otherwise a NullPointerException is thrown
- Throws:
NullPointerException
- if the specified key is null or does not exist
-