Package com.googlecode.javaewah
Class EWAHIterator
- java.lang.Object
-
- com.googlecode.javaewah.EWAHIterator
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class EWAHIterator extends java.lang.Object implements java.lang.Cloneable
The class EWAHIterator represents a special type of efficient iterator iterating over (uncompressed) words of bits. It is not meant for end users.- Since:
- 0.1.0
-
-
Field Summary
Fields Modifier and Type Field Description private int
pointer
The pointer represent the location of the current running length word in the array of words (embedded in the rlw attribute).(package private) RunningLengthWord
rlw
The current running length word.private int
size
The size in words.
-
Constructor Summary
Constructors Modifier Constructor Description private
EWAHIterator(int pointer, RunningLengthWord rlw, int size)
EWAHIterator(Buffer buffer)
Instantiates a new EWAH iterator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Buffer
buffer()
Access to the bufferEWAHIterator
clone()
static EWAHIterator
getEWAHIterator(EWAHCompressedBitmap bitmap)
Allow expert developers to instantiate an EWAHIterator.boolean
hasNext()
Checks for next.int
literalWords()
Position of the literal words represented by this running length word.RunningLengthWord
next()
Next running length word.
-
-
-
Field Detail
-
pointer
private int pointer
The pointer represent the location of the current running length word in the array of words (embedded in the rlw attribute).
-
rlw
final RunningLengthWord rlw
The current running length word.
-
size
private final int size
The size in words.
-
-
Constructor Detail
-
EWAHIterator
public EWAHIterator(Buffer buffer)
Instantiates a new EWAH iterator.- Parameters:
buffer
- the buffer
-
EWAHIterator
private EWAHIterator(int pointer, RunningLengthWord rlw, int size)
-
-
Method Detail
-
getEWAHIterator
public static EWAHIterator getEWAHIterator(EWAHCompressedBitmap bitmap)
Allow expert developers to instantiate an EWAHIterator.- Parameters:
bitmap
- we want to iterate over- Returns:
- an iterator
-
buffer
public Buffer buffer()
Access to the buffer- Returns:
- the buffer
-
literalWords
public int literalWords()
Position of the literal words represented by this running length word.- Returns:
- the int
-
hasNext
public boolean hasNext()
Checks for next.- Returns:
- true, if successful
-
next
public RunningLengthWord next()
Next running length word.- Returns:
- the running length word
-
clone
public EWAHIterator clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-