Class BmLongSegmentSyncMap<T>
- java.lang.Object
-
- com._1c.g5.v8.bm.common.collections.BmLongSegmentSyncMap<T>
-
- All Implemented Interfaces:
IBmLongMap<T>
public class BmLongSegmentSyncMap<T> extends Object implements 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 Constructor Description BmLongSegmentSyncMap(int segmentCount)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all mappings from this hash map, leaving it empty.boolean
containsKey(long key)
Checks if the map contains the specified key.Iterable<IBmLongMap.IEntry<T>>
entryIterable()
Returns aIterable
view of the entries in this map.T
get(long key)
Returns the value of the mapping with the specified key.boolean
isEmpty()
Returns whether this map is empty.Collection<Long>
keys()
Gets keys contained in this map.T
put(long key, T value)
Maps the specified key to the specified value.void
putAll(Map<Long,T> map)
Copies all of the mappings from the specified map to this map.T
remove(long key)
Removes the mapping with the specified key from this map.int
size()
Returns the number of elements in this map.Collection<T>
values()
Gets values contained in this map.
-
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:IBmLongMap
Removes all mappings from this hash map, leaving it empty.- Specified by:
clear
in interfaceIBmLongMap<T>
- See Also:
IBmLongMap.isEmpty()
,IBmLongMap.size()
-
get
public T get(long key)
Description copied from interface:IBmLongMap
Returns the value of the mapping with the specified key.- Specified by:
get
in interfaceIBmLongMap<T>
- 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
public T put(long key, T value)
Description copied from interface:IBmLongMap
Maps the specified key to the specified value.- Specified by:
put
in interfaceIBmLongMap<T>
- 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.
-
putAll
public void putAll(Map<Long,T> map)
Copies all of the mappings from the specified map to this map.- Parameters:
map
- the map to copy mappings from, may not benull
.
-
remove
public T remove(long key)
Description copied from interface:IBmLongMap
Removes the mapping with the specified key from this map.- Specified by:
remove
in interfaceIBmLongMap<T>
- 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
public boolean containsKey(long key)
Description copied from interface:IBmLongMap
Checks if the map contains the specified key.- Specified by:
containsKey
in interfaceIBmLongMap<T>
- Parameters:
key
- the key to check.- Returns:
true
if the map contains the specified key,false
otherwise.
-
entryIterable
public Iterable<IBmLongMap.IEntry<T>> entryIterable()
Description copied from interface:IBmLongMap
Returns aIterable
view of the entries in this map.- Specified by:
entryIterable
in interfaceIBmLongMap<T>
- Returns:
-
keys
public Collection<Long> keys()
Description copied from interface:IBmLongMap
Gets keys contained in this map.- Specified by:
keys
in interfaceIBmLongMap<T>
- Returns:
- a collection of keys, never
null
.
-
values
public Collection<T> values()
Description copied from interface:IBmLongMap
Gets values contained in this map.- Specified by:
values
in interfaceIBmLongMap<T>
- Returns:
- a collection of values, never
null
.
-
size
public int size()
Description copied from interface:IBmLongMap
Returns the number of elements in this map.- Specified by:
size
in interfaceIBmLongMap<T>
- Returns:
- the number of elements in this map.
-
isEmpty
public boolean isEmpty()
Description copied from interface:IBmLongMap
Returns whether this map is empty.- Specified by:
isEmpty
in interfaceIBmLongMap<T>
- Returns:
true
if this map has no elements,false
otherwise.- See Also:
IBmLongMap.size()
-
-