Class BmLongSegmentSyncSet
- java.lang.Object
-
- com._1c.g5.v8.bm.common.collections.BmLongSegmentSyncSet
-
- All Implemented Interfaces:
IBmLongSet
public class BmLongSegmentSyncSet extends Object implements IBmLongSet
A Long set 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.IBmLongSet
IBmLongSet.Entry
-
-
Field Summary
Fields Modifier and Type Field Description protected longhashSalt
-
Constructor Summary
Constructors Constructor Description BmLongSegmentSyncSet(int segments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(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.voidaddAll(Iterable<Long> values)Adds all the values from the specified collection.BmLongHashSetasMap()voidclear()Removes all the elements.booleancontains(long key)Checks if the set contains the specified element.List<Long>copyKeys()Iterable<IBmLongSet.Entry>entryIterator()Gets entry iterator.IBmLongSetgetMap(long key)BmLongHashSet[]getSegments()protected longhashSaltValue()booleanhaveItems()booleanisEmpty()Checks whether this set is empty.IBmLongIteratoriterator()Gets the long value iteratorCollection<Long>keys()Gets collection of elements.booleanremove(long key)Removes the specified element.voidremoveAll(Set<Long> set)intsize()Returns the number of elements in this set.
-
-
-
Method Detail
-
hashSaltValue
protected long hashSaltValue()
-
entryIterator
public Iterable<IBmLongSet.Entry> entryIterator()
Description copied from interface:IBmLongSetGets entry iterator.- Specified by:
entryIteratorin interfaceIBmLongSet- Returns:
- an entry iterator.
-
iterator
public IBmLongIterator iterator()
Description copied from interface:IBmLongSetGets the long value iterator- Specified by:
iteratorin interfaceIBmLongSet- Returns:
- The iterator of values. May not be
null
-
clear
public void clear()
Description copied from interface:IBmLongSetRemoves all the elements.- Specified by:
clearin interfaceIBmLongSet- See Also:
IBmLongSet.isEmpty(),IBmLongSet.size()
-
getMap
public IBmLongSet getMap(long key)
-
contains
public boolean contains(long key)
Description copied from interface:IBmLongSetChecks if the set contains the specified element.- Specified by:
containsin interfaceIBmLongSet- Parameters:
key- the element.- Returns:
trueif set contains the specified element,falseotherwise.
-
add
public void add(long key)
Description copied from interface:IBmLongSetAdds the specified element.- Specified by:
addin interfaceIBmLongSet- Parameters:
key- the element to add.
-
remove
public boolean remove(long key)
Description copied from interface:IBmLongSetRemoves the specified element.- Specified by:
removein interfaceIBmLongSet- Parameters:
key- the element to remove.- Returns:
trueif this set contained the specified element,falseotherwise.
-
size
public int size()
Description copied from interface:IBmLongSetReturns the number of elements in this set.- Specified by:
sizein interfaceIBmLongSet- Returns:
- the number of elements in this set.
-
asMap
public BmLongHashSet asMap()
-
getSegments
public BmLongHashSet[] getSegments()
-
haveItems
public boolean haveItems()
-
addAll
public void addAll(IBmLongSet values)
Description copied from interface:IBmLongSetAdds all the values from the specified collection.- Specified by:
addAllin interfaceIBmLongSet- Parameters:
values- the collection of values to add.
-
addAll
public void addAll(Iterable<Long> values)
Description copied from interface:IBmLongSetAdds all the values from the specified collection.- Specified by:
addAllin interfaceIBmLongSet- Parameters:
values- the collection of values to add.
-
addAll
public void addAll(long[] array)
Description copied from interface:IBmLongSetAdds all the values from the specified array.- Specified by:
addAllin interfaceIBmLongSet- Parameters:
array- the array. May not benull.
-
isEmpty
public boolean isEmpty()
Description copied from interface:IBmLongSetChecks whether this set is empty.- Specified by:
isEmptyin interfaceIBmLongSet- Returns:
trueif this set has no elements,falseotherwise.- See Also:
IBmLongSet.size()
-
keys
public Collection<Long> keys()
Description copied from interface:IBmLongSetGets collection of elements.- Specified by:
keysin interfaceIBmLongSet- Returns:
- the collection of elements.
-
-