Package com.googlecode.javaewah
Class ChunkIteratorImpl
java.lang.Object
com.googlecode.javaewah.ChunkIteratorImpl
- All Implemented Interfaces:
ChunkIterator
The ChunkIteratorImpl is the 64 bit implementation of the ChunkIterator
interface, which efficiently returns the chunks of ones and zeros represented by an
EWAHIterator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Bufferprivate final EWAHIteratorprivate booleanprivate Booleanprivate intprivate intprivate booleanprivate intprivate final intprivate longprivate intprivate longprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanbooleanhasNext()Is there more?private booleanprivate booleanvoidmove()Move the iterator at the next different bitvoidmove(int bits) Move the iterator at the next ith bitprivate voidmovePosition(int offset) private booleanbooleannextBit()Return the next bitintReturn the length of the next bitprivate RunningLengthWordnextRLW()private booleanprivate intprivate voidsetRLW(RunningLengthWord rlw) private voidprivate void
-
Field Details
-
ewahIter
-
sizeInBits
private final int sizeInBits -
buffer
-
position
private int position -
runningBit
private boolean runningBit -
runningLength
private int runningLength -
word
private long word -
wordMask
private long wordMask -
wordPosition
private int wordPosition -
wordLength
private int wordLength -
hasNext
private boolean hasNext -
nextBit
-
nextLength
private int nextLength
-
-
Constructor Details
-
ChunkIteratorImpl
ChunkIteratorImpl(EWAHIterator ewahIter, int sizeInBits)
-
-
Method Details
-
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
-
runningHasNext
private boolean runningHasNext() -
literalHasNext
private boolean literalHasNext() -
hasNextRLW
private boolean hasNextRLW() -
nextRLW
-
updateNext
private void updateNext() -
runningOffset
private int runningOffset() -
movePosition
private void movePosition(int offset) -
currentWordBit
private boolean currentWordBit() -
shiftWordMask
private void shiftWordMask()
-