-
- Type Parameters:
V
- the value type stored in the map.
- All Known Implementing Classes:
ShortObjectHashMap
public interface ShortObjectMap<V> extends Map<Short,V>
Interface for a primitive map that usesshort
s as keys.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ShortObjectMap.PrimitiveEntry<V>
A primitive entry in the map, provided by the iterator fromentries()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
containsKey(short key)
Indicates whether or not this map contains a value for the specified key.Iterable<ShortObjectMap.PrimitiveEntry<V>>
entries()
Gets an iterable to traverse over the primitive entries contained in this map.V
get(short key)
Gets the value in the map with the specified key.V
put(short key, V value)
Puts the given entry into the map.V
remove(short key)
Removes the entry with the specified key.-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
get
V get(short key)
Gets the value in the map with the specified key.- Parameters:
key
- the key whose associated value is to be returned.- Returns:
- the value or
null
if the key was not found in the map.
-
put
V put(short key, V value)
Puts the given entry into the map.- Parameters:
key
- the key of the entry.value
- the value of the entry.- Returns:
- the previous value for this key or
null
if there was no previous mapping.
-
remove
V remove(short key)
Removes the entry with the specified key.- Parameters:
key
- the key for the entry to be removed from this map.- Returns:
- the previous value for the key, or
null
if there was no mapping.
-
entries
Iterable<ShortObjectMap.PrimitiveEntry<V>> entries()
Gets an iterable to traverse over the primitive entries contained in this map. As an optimization, theShortObjectMap.PrimitiveEntry
s returned by theIterator
may change as theIterator
progresses. The caller should not rely onShortObjectMap.PrimitiveEntry
key/value stability.
-
containsKey
boolean containsKey(short key)
Indicates whether or not this map contains a value for the specified key.
-
-