Package com.googlecode.javaewah32
Class ChunkIteratorImpl32
- java.lang.Object
-
- com.googlecode.javaewah32.ChunkIteratorImpl32
-
- All Implemented Interfaces:
ChunkIterator
final class ChunkIteratorImpl32 extends java.lang.Object implements ChunkIterator
The ChunkIteratorImpl is the 32 bit implementation of the ChunkIterator interface, which efficiently returns the chunks of ones and zeros represented by an EWAHIterator.
-
-
Field Summary
Fields Modifier and Type Field Description private Buffer32bufferprivate EWAHIterator32ewahIterprivate booleanhasNextprivate java.lang.BooleannextBitprivate intnextLengthprivate intpositionprivate booleanrunningBitprivate intrunningLengthprivate intsizeInBitsprivate intwordprivate intwordLengthprivate intwordMaskprivate intwordPosition
-
Constructor Summary
Constructors Constructor Description ChunkIteratorImpl32(EWAHIterator32 ewahIter, int sizeInBits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancurrentWordBit()booleanhasNext()Is there more?private booleanhasNextRLW()private booleanliteralHasNext()voidmove()Move the iterator at the next different bitvoidmove(int bits)Move the iterator at the next ith bitprivate voidmovePosition(int offset)private booleanmoveToNextRLW()booleannextBit()Return the next bitintnextLength()Return the length of the next bitprivate RunningLengthWord32nextRLW()private booleanrunningHasNext()private intrunningOffset()private voidsetRLW(RunningLengthWord32 rlw)private voidshiftWordMask()private voidupdateNext()
-
-
-
Field Detail
-
ewahIter
private final EWAHIterator32 ewahIter
-
sizeInBits
private final int sizeInBits
-
buffer
private final Buffer32 buffer
-
position
private int position
-
runningBit
private boolean runningBit
-
runningLength
private int runningLength
-
word
private int word
-
wordMask
private int wordMask
-
wordPosition
private int wordPosition
-
wordLength
private int wordLength
-
hasNext
private boolean hasNext
-
nextBit
private java.lang.Boolean nextBit
-
nextLength
private int nextLength
-
-
Constructor Detail
-
ChunkIteratorImpl32
ChunkIteratorImpl32(EWAHIterator32 ewahIter, int sizeInBits)
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:ChunkIteratorIs there more?- Specified by:
hasNextin interfaceChunkIterator- Returns:
- true, if there is more, false otherwise
-
nextBit
public boolean nextBit()
Description copied from interface:ChunkIteratorReturn the next bit- Specified by:
nextBitin interfaceChunkIterator- Returns:
- the bit
-
nextLength
public int nextLength()
Description copied from interface:ChunkIteratorReturn the length of the next bit- Specified by:
nextLengthin interfaceChunkIterator- Returns:
- the length
-
move
public void move()
Description copied from interface:ChunkIteratorMove the iterator at the next different bit- Specified by:
movein interfaceChunkIterator
-
move
public void move(int bits)
Description copied from interface:ChunkIteratorMove the iterator at the next ith bit- Specified by:
movein interfaceChunkIterator- Parameters:
bits- the number of bits to skip
-
moveToNextRLW
private boolean moveToNextRLW()
-
setRLW
private void setRLW(RunningLengthWord32 rlw)
-
runningHasNext
private boolean runningHasNext()
-
literalHasNext
private boolean literalHasNext()
-
hasNextRLW
private boolean hasNextRLW()
-
nextRLW
private RunningLengthWord32 nextRLW()
-
updateNext
private void updateNext()
-
runningOffset
private int runningOffset()
-
movePosition
private void movePosition(int offset)
-
currentWordBit
private boolean currentWordBit()
-
shiftWordMask
private void shiftWordMask()
-
-