Class MultiBitSetBag
java.lang.Object
uk.ac.starlink.ttools.moc.MultiBitSetBag
- All Implemented Interfaces:
IndexBag
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault size for a single BitSet. -
Constructor Summary
ConstructorsConstructorDescriptionMultiBitSetBag(long size) Constructs a bag with a default bank size.MultiBitSetBag(long size, int bankSize) Constructs a bag with a specified bank size. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndex(long lindex) Adds an index to this bag.longgetCount()Returns the number of distinct indices in this bag.booleanhasIndex(long lindex) Indicates whether the given index has previously been added to this bag.Returns an iterator over all the integers added to this bag, supplied in ascending order.
-
Field Details
-
DFLT_BANKSIZE
public static final int DFLT_BANKSIZEDefault size for a single BitSet.- See Also:
-
-
Constructor Details
-
MultiBitSetBag
public MultiBitSetBag(long size) Constructs a bag with a default bank size. Non-negative integers smaller than the given size value can be held.- Parameters:
size- one greater than the largest permitted value
-
MultiBitSetBag
public MultiBitSetBag(long size, int bankSize) Constructs a bag with a specified bank size. Non-negative integers smaller than the given size value can be held.- Parameters:
size- one greater than the largest permitted valuebankSize- size of sub-buffers into which the storage is divided
-
-
Method Details
-
addIndex
public void addIndex(long lindex) Description copied from interface:IndexBagAdds an index to this bag. If the index is already present, there is no effect.If the index is outside of the range permitted by this bag, behaviour is undefined.
-
hasIndex
public boolean hasIndex(long lindex) Description copied from interface:IndexBagIndicates whether the given index has previously been added to this bag.If the index is outside of the range permitted by this bag, behaviour is undefined.
-
getCount
-
sortedLongIterator
Description copied from interface:IndexBagReturns an iterator over all the integers added to this bag, supplied in ascending order.- Specified by:
sortedLongIteratorin interfaceIndexBag- Returns:
- sorted iterator over indices
-