Package com.googlecode.javaewah
Class ChunkIteratorImpl
- java.lang.Object
-
- com.googlecode.javaewah.ChunkIteratorImpl
-
- All Implemented Interfaces:
ChunkIterator
final class ChunkIteratorImpl extends java.lang.Object implements 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
Fields Modifier and Type Field Description private Buffer
buffer
private EWAHIterator
ewahIter
private boolean
hasNext
private java.lang.Boolean
nextBit
private int
nextLength
private int
position
private boolean
runningBit
private int
runningLength
private int
sizeInBits
private long
word
private int
wordLength
private long
wordMask
private int
wordPosition
-
Constructor Summary
Constructors Constructor Description ChunkIteratorImpl(EWAHIterator ewahIter, int sizeInBits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
currentWordBit()
boolean
hasNext()
Is there more?private boolean
hasNextRLW()
private boolean
literalHasNext()
void
move()
Move the iterator at the next different bitvoid
move(int bits)
Move the iterator at the next ith bitprivate void
movePosition(int offset)
private boolean
moveToNextRLW()
boolean
nextBit()
Return the next bitint
nextLength()
Return the length of the next bitprivate RunningLengthWord
nextRLW()
private boolean
runningHasNext()
private int
runningOffset()
private void
setRLW(RunningLengthWord rlw)
private void
shiftWordMask()
private void
updateNext()
-
-
-
Field Detail
-
ewahIter
private final EWAHIterator ewahIter
-
sizeInBits
private final int sizeInBits
-
buffer
private final Buffer 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
private java.lang.Boolean nextBit
-
nextLength
private int nextLength
-
-
Constructor Detail
-
ChunkIteratorImpl
ChunkIteratorImpl(EWAHIterator ewahIter, int sizeInBits)
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:ChunkIterator
Is there more?- Specified by:
hasNext
in interfaceChunkIterator
- Returns:
- true, if there is more, false otherwise
-
nextBit
public boolean nextBit()
Description copied from interface:ChunkIterator
Return the next bit- Specified by:
nextBit
in interfaceChunkIterator
- Returns:
- the bit
-
nextLength
public int nextLength()
Description copied from interface:ChunkIterator
Return the length of the next bit- Specified by:
nextLength
in interfaceChunkIterator
- Returns:
- the length
-
move
public void move()
Description copied from interface:ChunkIterator
Move the iterator at the next different bit- Specified by:
move
in interfaceChunkIterator
-
move
public void move(int bits)
Description copied from interface:ChunkIterator
Move the iterator at the next ith bit- Specified by:
move
in interfaceChunkIterator
- Parameters:
bits
- the number of bits to skip
-
moveToNextRLW
private boolean moveToNextRLW()
-
setRLW
private void setRLW(RunningLengthWord rlw)
-
runningHasNext
private boolean runningHasNext()
-
literalHasNext
private boolean literalHasNext()
-
hasNextRLW
private boolean hasNextRLW()
-
nextRLW
private RunningLengthWord nextRLW()
-
updateNext
private void updateNext()
-
runningOffset
private int runningOffset()
-
movePosition
private void movePosition(int offset)
-
currentWordBit
private boolean currentWordBit()
-
shiftWordMask
private void shiftWordMask()
-
-