Class BmLongHashMap<V>
- java.lang.Object
- 
- com._1c.g5.v8.bm.common.collections.BmLongHashMap<V>
 
- 
- All Implemented Interfaces:
- IBmLongMap<V>
 
 public class BmLongHashMap<V> extends Object implements IBmLongMap<V> This code is adoption of 'HashMap' from Apache Harmony refactored to support primitive long keys.
 This implementation doesn't support removal of entries via itearator.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classBmLongHashMap.MapIterator<V>- 
Nested classes/interfaces inherited from interface com._1c.g5.v8.bm.common.collections.IBmLongMapIBmLongMap.IEntry<V>
 
- 
 - 
Constructor SummaryConstructors Constructor Description BmLongHashMap()Constructs a new emptyHashMapinstance.BmLongHashMap(int capacity)Constructs a newHashMapinstance with the specified capacity.BmLongHashMap(int capacity, float loadFactor)Constructs a newHashMapinstance with the specified capacity and load factor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all mappings from this hash map, leaving it empty.protected intcomputeKeyHash(long key)Computes key hash.booleancontainsKey(long key)Checks if the map contains the specified key.Iterable<IBmLongMap.IEntry<V>>entryIterable()Returns aIterableview of the entries in this map.Vget(long key)Returns the value of the mapping with the specified key.booleanisEmpty()Returns whether this map is empty.Collection<Long>keys()Gets keys contained in this map.Vput(long key, V value)Maps the specified key to the specified value.voidputAll(BmLongHashMap<V> values)Copies all of the mappings from the specified map to this map.voidputAll(Map<Long,V> values)Copies all of the mappings from the specified map to this map.Vremove(long key)Removes the mapping with the specified key from this map.intsize()Returns the number of elements in this map.List<V>values()Gets values contained in this map.
 
- 
- 
- 
Constructor Detail- 
BmLongHashMappublic BmLongHashMap() Constructs a new emptyHashMapinstance.
 - 
BmLongHashMappublic BmLongHashMap(int capacity) Constructs a newHashMapinstance with the specified capacity.- Parameters:
- capacity- the initial capacity of this hash map.
- Throws:
- IllegalArgumentException- when the capacity is less than zero.
 
 - 
BmLongHashMappublic BmLongHashMap(int capacity, float loadFactor)Constructs a newHashMapinstance with the specified capacity and load factor.- Parameters:
- capacity- the initial capacity of this hash map.
- loadFactor- the initial load factor.
- Throws:
- IllegalArgumentException- when the capacity is less than zero or the load factor is less or equal to zero.
 
 
- 
 - 
Method Detail- 
clearpublic void clear() Description copied from interface:IBmLongMapRemoves all mappings from this hash map, leaving it empty.- Specified by:
- clearin interface- IBmLongMap<V>
- See Also:
- IBmLongMap.isEmpty(),- IBmLongMap.size()
 
 - 
getpublic V get(long key) Description copied from interface:IBmLongMapReturns the value of the mapping with the specified key.- Specified by:
- getin interface- IBmLongMap<V>
- Parameters:
- key- the key.
- Returns:
- the value of the mapping with the specified key, or nullif no mapping for the specified key is found.
 
 - 
isEmptypublic boolean isEmpty() Description copied from interface:IBmLongMapReturns whether this map is empty.- Specified by:
- isEmptyin interface- IBmLongMap<V>
- Returns:
- trueif this map has no elements,- falseotherwise.
- See Also:
- IBmLongMap.size()
 
 - 
putpublic V put(long key, V value) Description copied from interface:IBmLongMapMaps the specified key to the specified value.- Specified by:
- putin interface- IBmLongMap<V>
- 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.
 
 - 
removepublic V remove(long key) Description copied from interface:IBmLongMapRemoves the mapping with the specified key from this map.- Specified by:
- removein interface- IBmLongMap<V>
- 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.
 
 - 
sizepublic int size() Description copied from interface:IBmLongMapReturns the number of elements in this map.- Specified by:
- sizein interface- IBmLongMap<V>
- Returns:
- the number of elements in this map.
 
 - 
entryIterablepublic Iterable<IBmLongMap.IEntry<V>> entryIterable() Description copied from interface:IBmLongMapReturns aIterableview of the entries in this map.- Specified by:
- entryIterablein interface- IBmLongMap<V>
- Returns:
 
 - 
putAllpublic void putAll(BmLongHashMap<V> values) Copies all of the mappings from the specified map to this map.- Parameters:
- map- the map to copy mappings from, may not be- null.
 
 - 
putAllpublic void putAll(Map<Long,V> values) Copies all of the mappings from the specified map to this map.- Parameters:
- map- the map to copy mappings from, may not be- null.
 
 - 
containsKeypublic boolean containsKey(long key) Description copied from interface:IBmLongMapChecks if the map contains the specified key.- Specified by:
- containsKeyin interface- IBmLongMap<V>
- Parameters:
- key- the key to check.
- Returns:
- trueif the map contains the specified key,- falseotherwise.
 
 - 
valuespublic List<V> values() Description copied from interface:IBmLongMapGets values contained in this map.- Specified by:
- valuesin interface- IBmLongMap<V>
- Returns:
- a collection of values, never null.
 
 - 
keyspublic Collection<Long> keys() Description copied from interface:IBmLongMapGets keys contained in this map.- Specified by:
- keysin interface- IBmLongMap<V>
- Returns:
- a collection of keys, never null.
 
 - 
computeKeyHashprotected int computeKeyHash(long key) Computes key hash.- Parameters:
- key- The key to compute hash for.
- Returns:
- the key hash.
 
 
- 
 
-