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 long
hashSalt
-
Constructor Summary
Constructors Constructor Description BmLongSegmentSyncSet(int segments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long key)
Adds the specified element.void
addAll(long[] array)
Adds all the values from the specified array.void
addAll(IBmLongSet values)
Adds all the values from the specified collection.void
addAll(Iterable<Long> values)
Adds all the values from the specified collection.BmLongHashSet
asMap()
void
clear()
Removes all the elements.boolean
contains(long key)
Checks if the set contains the specified element.List<Long>
copyKeys()
Iterable<IBmLongSet.Entry>
entryIterator()
Gets entry iterator.IBmLongSet
getMap(long key)
BmLongHashSet[]
getSegments()
protected long
hashSaltValue()
boolean
haveItems()
boolean
isEmpty()
Checks whether this set is empty.IBmLongIterator
iterator()
Gets the long value iteratorCollection<Long>
keys()
Gets collection of elements.boolean
remove(long key)
Removes the specified element.void
removeAll(Set<Long> set)
int
size()
Returns the number of elements in this set.
-
-
-
Method Detail
-
hashSaltValue
protected long hashSaltValue()
-
entryIterator
public Iterable<IBmLongSet.Entry> entryIterator()
Description copied from interface:IBmLongSet
Gets entry iterator.- Specified by:
entryIterator
in interfaceIBmLongSet
- Returns:
- an entry iterator.
-
iterator
public IBmLongIterator iterator()
Description copied from interface:IBmLongSet
Gets the long value iterator- Specified by:
iterator
in interfaceIBmLongSet
- Returns:
- The iterator of values. May not be
null
-
clear
public void clear()
Description copied from interface:IBmLongSet
Removes all the elements.- Specified by:
clear
in interfaceIBmLongSet
- See Also:
IBmLongSet.isEmpty()
,IBmLongSet.size()
-
getMap
public IBmLongSet getMap(long key)
-
contains
public boolean contains(long key)
Description copied from interface:IBmLongSet
Checks if the set contains the specified element.- Specified by:
contains
in interfaceIBmLongSet
- Parameters:
key
- the element.- Returns:
true
if set contains the specified element,false
otherwise.
-
add
public void add(long key)
Description copied from interface:IBmLongSet
Adds the specified element.- Specified by:
add
in interfaceIBmLongSet
- Parameters:
key
- the element to add.
-
remove
public boolean remove(long key)
Description copied from interface:IBmLongSet
Removes the specified element.- Specified by:
remove
in interfaceIBmLongSet
- Parameters:
key
- the element to remove.- Returns:
true
if this set contained the specified element,false
otherwise.
-
size
public int size()
Description copied from interface:IBmLongSet
Returns the number of elements in this set.- Specified by:
size
in 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:IBmLongSet
Adds all the values from the specified collection.- Specified by:
addAll
in interfaceIBmLongSet
- Parameters:
values
- the collection of values to add.
-
addAll
public void addAll(Iterable<Long> values)
Description copied from interface:IBmLongSet
Adds all the values from the specified collection.- Specified by:
addAll
in interfaceIBmLongSet
- Parameters:
values
- the collection of values to add.
-
addAll
public void addAll(long[] array)
Description copied from interface:IBmLongSet
Adds all the values from the specified array.- Specified by:
addAll
in interfaceIBmLongSet
- Parameters:
array
- the array. May not benull
.
-
isEmpty
public boolean isEmpty()
Description copied from interface:IBmLongSet
Checks whether this set is empty.- Specified by:
isEmpty
in interfaceIBmLongSet
- Returns:
true
if this set has no elements,false
otherwise.- See Also:
IBmLongSet.size()
-
keys
public Collection<Long> keys()
Description copied from interface:IBmLongSet
Gets collection of elements.- Specified by:
keys
in interfaceIBmLongSet
- Returns:
- the collection of elements.
-
-