Class BmLongSegmentSyncMap<T>
java.lang.Object
com._1c.g5.v8.bm.common.collections.BmLongSegmentSyncMap<T>
- All Implemented Interfaces:
IBmLongMap<T>
A Long map with segment synchronization.
Implementation limited only for put/get/remove operations.
Iterations are not supported.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com._1c.g5.v8.bm.common.collections.IBmLongMap
IBmLongMap.IEntry<V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all mappings from this hash map, leaving it empty.booleancontainsKey(long key) Checks if the map contains the specified key.Returns aIterableview of the entries in this map.get(long key) Returns the value of the mapping with the specified key.booleanisEmpty()Returns whether this map is empty.keys()Gets keys contained in this map.Maps the specified key to the specified value.voidCopies all of the mappings from the specified map to this map.remove(long key) Removes the mapping with the specified key from this map.intsize()Returns the number of elements in this map.values()Gets values contained in this map.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com._1c.g5.v8.bm.common.collections.IBmLongMap
putAll
-
Constructor Details
-
BmLongSegmentSyncMap
public BmLongSegmentSyncMap(int segmentCount) Constructs a new instance.- Parameters:
segmentCount- The segment count, must be a power of two.
-
-
Method Details
-
clear
public void clear()Description copied from interface:IBmLongMapRemoves all mappings from this hash map, leaving it empty.- Specified by:
clearin interfaceIBmLongMap<T>- See Also:
-
get
Description copied from interface:IBmLongMapReturns the value of the mapping with the specified key.- Specified by:
getin interfaceIBmLongMap<T>- Parameters:
key- the key.- Returns:
- the value of the mapping with the specified key, or
nullif no mapping for the specified key is found.
-
put
Description copied from interface:IBmLongMapMaps the specified key to the specified value.- Specified by:
putin interfaceIBmLongMap<T>- Parameters:
key- the key.value- the value.- Returns:
- the value of any previous mapping with the specified key or
nullif there was no such mapping.
-
putAll
Copies all of the mappings from the specified map to this map.- Specified by:
putAllin interfaceIBmLongMap<T>- Parameters:
map- the map to copy mappings from, may not benull.
-
remove
Description copied from interface:IBmLongMapRemoves the mapping with the specified key from this map.- Specified by:
removein interfaceIBmLongMap<T>- Parameters:
key- the key of the mapping to remove.- Returns:
- the value of the removed mapping or
nullif no mapping for the specified key was found.
-
containsKey
public boolean containsKey(long key) Description copied from interface:IBmLongMapChecks if the map contains the specified key.- Specified by:
containsKeyin interfaceIBmLongMap<T>- Parameters:
key- the key to check.- Returns:
trueif the map contains the specified key,falseotherwise.
-
entryIterable
Description copied from interface:IBmLongMapReturns aIterableview of the entries in this map.- Specified by:
entryIterablein interfaceIBmLongMap<T>- Returns:
-
keys
Description copied from interface:IBmLongMapGets keys contained in this map.- Specified by:
keysin interfaceIBmLongMap<T>- Returns:
- a collection of keys, never
null.
-
values
Description copied from interface:IBmLongMapGets values contained in this map.- Specified by:
valuesin interfaceIBmLongMap<T>- Returns:
- a collection of values, never
null.
-
size
public int size()Description copied from interface:IBmLongMapReturns the number of elements in this map.- Specified by:
sizein interfaceIBmLongMap<T>- Returns:
- the number of elements in this map.
-
isEmpty
public boolean isEmpty()Description copied from interface:IBmLongMapReturns whether this map is empty.- Specified by:
isEmptyin interfaceIBmLongMap<T>- Returns:
trueif this map has no elements,falseotherwise.- See Also:
-