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 Buffer
private final EWAHIterator
private boolean
private Boolean
private int
private int
private boolean
private int
private final int
private long
private int
private long
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
boolean
hasNext()
Is there more?private boolean
private boolean
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
boolean
nextBit()
Return the next bitint
Return the length of the next bitprivate RunningLengthWord
nextRLW()
private boolean
private int
private void
setRLW
(RunningLengthWord rlw) private void
private 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: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
-
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()
-