Package com.googlecode.javaewah32
Class BufferedIterator32
java.lang.Object
com.googlecode.javaewah32.BufferedIterator32
- All Implemented Interfaces:
IteratingRLW32
,Cloneable
This class can be used to iterate over blocks of bitmap data.
- Author:
- Daniel Lemire
-
Constructor Summary
ConstructorsConstructorDescriptionBufferedIterator32(CloneableIterator<EWAHIterator32> iterator)
Instantiates a new iterating buffered running length word. -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
discardFirstWords(int x)
Discard first words, iterating to the next running length word if needed.void
discardLiteralWords(int x)
Discard x literal words (assumes that there is no running word)void
Discard all running wordsint
getLiteralWordAt(int index)
Get the nth literal word for the current running length wordint
Gets the number of literal words for the current running length word.boolean
Gets the running bit.int
Gets the running length.boolean
next()
Move to the next RunningLengthWordint
size()
Size in uncompressed words of the current running length word.
-
Constructor Details
-
BufferedIterator32
Instantiates a new iterating buffered running length word.- Parameters:
iterator
- iterator
-
-
Method Details
-
discardFirstWords
public void discardFirstWords(int x)Discard first words, iterating to the next running length word if needed.- Specified by:
discardFirstWords
in interfaceIteratingRLW32
- Parameters:
x
- the number of words to be discarded
-
discardLiteralWords
public void discardLiteralWords(int x)Description copied from interface:IteratingRLW32
Discard x literal words (assumes that there is no running word)- Specified by:
discardLiteralWords
in interfaceIteratingRLW32
- Parameters:
x
- the number of words to discard
-
discardRunningWords
public void discardRunningWords()Description copied from interface:IteratingRLW32
Discard all running words- Specified by:
discardRunningWords
in interfaceIteratingRLW32
-
next
public boolean next()Move to the next RunningLengthWord- Specified by:
next
in interfaceIteratingRLW32
- Returns:
- whether the move was possible
-
getLiteralWordAt
public int getLiteralWordAt(int index)Get the nth literal word for the current running length word- Specified by:
getLiteralWordAt
in interfaceIteratingRLW32
- Parameters:
index
- zero based index- Returns:
- the literal word
-
getNumberOfLiteralWords
public int getNumberOfLiteralWords()Gets the number of literal words for the current running length word.- Specified by:
getNumberOfLiteralWords
in interfaceIteratingRLW32
- Returns:
- the number of literal words
-
getRunningBit
public boolean getRunningBit()Gets the running bit. RunningBit- Specified by:
getRunningBit
in interfaceIteratingRLW32
- Returns:
- the running bit
-
getRunningLength
public int getRunningLength()Gets the running length.- Specified by:
getRunningLength
in interfaceIteratingRLW32
- Returns:
- the running length
-
size
public int size()Size in uncompressed words of the current running length word.- Specified by:
size
in interfaceIteratingRLW32
- Returns:
- the size
-
clone
- Specified by:
clone
in interfaceIteratingRLW32
- Overrides:
clone
in classObject
- Returns:
- a copy of the iterator
- Throws:
CloneNotSupportedException
- this should not be thrown in theory
-