Class IntegerBag
java.lang.Object
uk.ac.starlink.ttools.moc.IntegerBag
- All Implemented Interfaces:
IndexBag
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an IntegerBag with a default set size threshold.IntegerBag(int setmax) Constructs an IntegerBag with a supplied set size threshold. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndex(long lval) Adds an index to this bag.longgetCount()Returns the number of distinct indices in this bag.booleanhasIndex(long lval) 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_SETMAX
public static final int DFLT_SETMAXDefault set size threshold.- See Also:
-
-
Constructor Details
-
IntegerBag
public IntegerBag()Constructs an IntegerBag with a default set size threshold. -
IntegerBag
public IntegerBag(int setmax) Constructs an IntegerBag with a supplied set size threshold.- Parameters:
setmax- maximum HashSet size
-
-
Method Details
-
hasIndex
public boolean hasIndex(long lval) 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.
-
addIndex
public void addIndex(long lval) 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.
-
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
-