Class BmLongHashSet
java.lang.Object
com._1c.g5.v8.bm.common.collections.BmLongHashSet
- All Implemented Interfaces:
- IBmLongSet
This code is adoption of 'HashMap' from Apache Harmony refactored to support primitive long keys.
This implementation doesn't support removal of elements via itearator.
This implementation doesn't support removal of elements via itearator.
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface com._1c.g5.v8.bm.common.collections.IBmLongSetIBmLongSet.Entry
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new emptyHashMapinstance.BmLongHashSet(int capacity) Constructs a newHashMapinstance with the specified capacity.BmLongHashSet(int capacity, float loadFactor) Constructs a newHashMapinstance with the specified capacity and load factor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(long key) Adds the specified element.voidaddAll(long[] array) Adds all the values from the specified array.voidaddAll(IBmLongSet values) Adds all the values from the specified collection.voidAdds all the values from the specified collection.voidclear()Removes all the elements.protected intcomputeKeyHash(long key) Computes key hash.booleancontains(long key) Checks if the set contains the specified element.booleancontainsAny(BmLongHashSet value) Checks if this set contains any element from the specified one.Gets entry iterator.booleanisEmpty()Checks whether this set is empty.iterator()Gets the long value iteratorkeys()Gets collection of elements.booleanremove(long key) Removes the specified element.voidremoveAll(IBmLongSet set) Removes from this set all of its elements that are contained in the specified set.intsize()Returns the number of elements in this set.
- 
Constructor Details- 
BmLongHashSetpublic BmLongHashSet()Constructs a new emptyHashMapinstance.
- 
BmLongHashSetpublic BmLongHashSet(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.
 
- 
BmLongHashSetpublic BmLongHashSet(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 Details- 
addpublic void add(long key) Description copied from interface:IBmLongSetAdds the specified element.- Specified by:
- addin interface- IBmLongSet
- Parameters:
- key- the element to add.
 
- 
addAllDescription copied from interface:IBmLongSetAdds all the values from the specified collection.- Specified by:
- addAllin interface- IBmLongSet
- Parameters:
- values- the collection of values to add.
 
- 
addAllDescription copied from interface:IBmLongSetAdds all the values from the specified collection.- Specified by:
- addAllin interface- IBmLongSet
- Parameters:
- values- the collection of values to add.
 
- 
addAllpublic void addAll(long[] array) Description copied from interface:IBmLongSetAdds all the values from the specified array.- Specified by:
- addAllin interface- IBmLongSet
- Parameters:
- array- the array. May not be- null.
 
- 
clearpublic void clear()Description copied from interface:IBmLongSetRemoves all the elements.- Specified by:
- clearin interface- IBmLongSet
- See Also:
 
- 
containspublic boolean contains(long key) Description copied from interface:IBmLongSetChecks if the set contains the specified element.- Specified by:
- containsin interface- IBmLongSet
- Parameters:
- key- the element.
- Returns:
- trueif set contains the specified element,- falseotherwise.
 
- 
containsAnyChecks if this set contains any element from the specified one.- Parameters:
- set- the set to run the check against, may not be- null.
- Returns:
- trueif this map contains any element from the specified one,- falseotherwise.
 
- 
entryIteratorDescription copied from interface:IBmLongSetGets entry iterator.- Specified by:
- entryIteratorin interface- IBmLongSet
- Returns:
- an entry iterator.
 
- 
iteratorDescription copied from interface:IBmLongSetGets the long value iterator- Specified by:
- iteratorin interface- IBmLongSet
- Returns:
- The iterator of values. May not be null
 
- 
isEmptypublic boolean isEmpty()Description copied from interface:IBmLongSetChecks whether this set is empty.- Specified by:
- isEmptyin interface- IBmLongSet
- Returns:
- trueif this set has no elements,- falseotherwise.
- See Also:
 
- 
keysDescription copied from interface:IBmLongSetGets collection of elements.- Specified by:
- keysin interface- IBmLongSet
- Returns:
- the collection of elements.
 
- 
removepublic boolean remove(long key) Description copied from interface:IBmLongSetRemoves the specified element.- Specified by:
- removein interface- IBmLongSet
- Parameters:
- key- the element to remove.
- Returns:
- trueif this set contained the specified element,- falseotherwise.
 
- 
removeAllRemoves from this set all of its elements that are contained in the specified set.- Parameters:
- set- The set containing elements to be removed from this set, may not be- null.
 
- 
sizepublic int size()Description copied from interface:IBmLongSetReturns the number of elements in this set.- Specified by:
- sizein interface- IBmLongSet
- Returns:
- the number of elements in this set.
 
- 
computeKeyHashprotected int computeKeyHash(long key) Computes key hash.- Parameters:
- key- The key to compute hash for.
- Returns:
- the key hash.
 
 
-