Interface IBmLongMap<V>
- Type Parameters:
V
-
- All Known Implementing Classes:
BmLongHashMap
,BmLongSegmentSyncMap
public interface IBmLongMap<V>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all mappings from this hash map, leaving it empty.boolean
containsKey
(long key) Checks if the map contains the specified key.Returns aIterable
view of the entries in this map.get
(long key) Returns the value of the mapping with the specified key.boolean
isEmpty()
Returns whether this map is empty.keys()
Gets keys contained in this map.Maps the specified key to the specified value.default void
putAll
(IBmLongMap<V> values) Copies all of the mappings from the specified map to this map.default void
Copies all of the mappings from the specified map to this map.remove
(long key) Removes the mapping with the specified key from this map.int
size()
Returns the number of elements in this map.values()
Gets values contained in this map.
-
Method Details
-
clear
void clear()Removes all mappings from this hash map, leaving it empty. -
get
Returns the value of the mapping with the specified key.- Parameters:
key
- the key.- Returns:
- the value of the mapping with the specified key, or
null
if no mapping for the specified key is found.
-
put
Maps the specified key to the specified value.- Parameters:
key
- the key.value
- the value.- Returns:
- the value of any previous mapping with the specified key or
null
if there was no such mapping.
-
remove
Removes the mapping with the specified key from this map.- Parameters:
key
- the key of the mapping to remove.- Returns:
- the value of the removed mapping or
null
if no mapping for the specified key was found.
-
containsKey
boolean containsKey(long key) Checks if the map contains the specified key.- Parameters:
key
- the key to check.- Returns:
true
if the map contains the specified key,false
otherwise.
-
values
Collection<V> values()Gets values contained in this map.- Returns:
- a collection of values, never
null
.
-
keys
Collection<Long> keys()Gets keys contained in this map.- Returns:
- a collection of keys, never
null
.
-
size
int size()Returns the number of elements in this map.- Returns:
- the number of elements in this map.
-
isEmpty
boolean isEmpty()Returns whether this map is empty.- Returns:
true
if this map has no elements,false
otherwise.- See Also:
-
entryIterable
Iterable<IBmLongMap.IEntry<V>> entryIterable()Returns aIterable
view of the entries in this map.- Returns:
-
putAll
Copies all of the mappings from the specified map to this map.- Parameters:
map
- the map to copy mappings from, may not benull
.
-
putAll
Copies all of the mappings from the specified map to this map.- Parameters:
map
- the map to copy mappings from, may not benull
.
-