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 Buffer32
buffer
private EWAHIterator32
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 int
word
private int
wordLength
private int
wordMask
private int
wordPosition
-
Constructor Summary
Constructors Constructor Description ChunkIteratorImpl32(EWAHIterator32 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 RunningLengthWord32
nextRLW()
private boolean
runningHasNext()
private int
runningOffset()
private void
setRLW(RunningLengthWord32 rlw)
private void
shiftWordMask()
private void
updateNext()
-
-
-
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: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(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()
-
-