Class BitSetIterator
- java.lang.Object
-
- net.automatalib.common.util.collection.BitSetIterator
-
- All Implemented Interfaces:
Iterator<Integer>
,PrimitiveIterator<Integer,IntConsumer>
,PrimitiveIterator.OfInt
public class BitSetIterator extends Object implements Iterator<Integer>, PrimitiveIterator.OfInt
Iterator for iterating over a BitSet like over a normal collection. The type returned by next() isInteger
. Supports mutable and immutable modes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
-
Constructor Summary
Constructors Constructor Description BitSetIterator(BitSet bitSet)
Default constructor for an immutable iterator.BitSetIterator(BitSet bitSet, boolean immutable)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
int
nextInt()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.PrimitiveIterator.OfInt
forEachRemaining, forEachRemaining, next
-
-
-
-
Constructor Detail
-
BitSetIterator
public BitSetIterator(BitSet bitSet)
Default constructor for an immutable iterator.- Parameters:
bitSet
- the bitset over which to iterate.
-
BitSetIterator
public BitSetIterator(BitSet bitSet, boolean immutable)
Constructor.- Parameters:
bitSet
- the bitset over which to iterateimmutable
- a flag indicating whether theIterator.remove()
method should be supported
-
-