Top Description Fields Constructors Methods
com.googlecode.javaewah

public Class BufferedIterator

extends Object
implements IteratingRLW, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.googlecode.javaewah.IteratingRLW

This class can be used to iterate over blocks of bitmap data.
Author
Daniel Lemire

Field Summary

Modifier and TypeField and Description
private IteratingBufferedRunningLengthWord
private CloneableIterator<EWAHIterator>

Constructor Summary

AccessConstructor and Description
public
BufferedIterator(final CloneableIterator<EWAHIterator>
iterator
iterator
)

Instantiates a new iterating buffered running length word.

Method Summary

Modifier and TypeMethod and Description
public BufferedIterator
clone()

Overrides java.lang.Object.clone.

Implements com.googlecode.javaewah.IteratingRLW.clone.

Creates and returns a copy of this object.

public void
discardFirstWords(long
the number of words to be discarded
x
)

Implements com.googlecode.javaewah.IteratingRLW.discardFirstWords.

Discard first words, iterating to the next running length word if needed.

public void
discardLiteralWords(long
the number of words to discard
x
)

Implements com.googlecode.javaewah.IteratingRLW.discardLiteralWords.

Discard x literal words (assumes that there is no running word)

public void
public long

Returns:

the literal word
getLiteralWordAt
(int
zero based index
index
)

Implements com.googlecode.javaewah.IteratingRLW.getLiteralWordAt.

Get the nth literal word for the current running length word

public int

Returns:

the number of literal words
getNumberOfLiteralWords
()

Implements com.googlecode.javaewah.IteratingRLW.getNumberOfLiteralWords.

Gets the number of literal words for the current running length word.

public boolean

Returns:

the running bit
getRunningBit
()

Implements com.googlecode.javaewah.IteratingRLW.getRunningBit.

Gets the running bit.

public long

Returns:

the running length
getRunningLength
()

Implements com.googlecode.javaewah.IteratingRLW.getRunningLength.

Gets the running length.

public boolean

Returns:

whether the move was possible
next
()

Implements com.googlecode.javaewah.IteratingRLW.next.

Move to the next RunningLengthWord

public long

Returns:

the size
size
()

Implements com.googlecode.javaewah.IteratingRLW.size.

Size in uncompressed words of the current running length word.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iteratingBrlwback to summary
private IteratingBufferedRunningLengthWord iteratingBrlw
masterIteratorback to summary
private CloneableIterator<EWAHIterator> masterIterator

Constructor Detail

BufferedIteratorback to summary
public BufferedIterator(final CloneableIterator<EWAHIterator> iterator)

Instantiates a new iterating buffered running length word.

Parameters
iterator:CloneableIterator<EWAHIterator>

iterator

Method Detail

cloneback to summary
public BufferedIterator clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Implements com.googlecode.javaewah.IteratingRLW.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:BufferedIterator

Doc from com.googlecode.javaewah.IteratingRLW.clone.

a copy of the iterator

Annotations
@Override
Exceptions
CloneNotSupportedException:

Doc from com.googlecode.javaewah.IteratingRLW.clone.

this should not be thrown in theory

discardFirstWordsback to summary
public void discardFirstWords(long x)

Implements com.googlecode.javaewah.IteratingRLW.discardFirstWords.

Discard first words, iterating to the next running length word if needed.

Parameters
x:long

the number of words to be discarded

Annotations
@Override
discardLiteralWordsback to summary
public void discardLiteralWords(long x)

Implements com.googlecode.javaewah.IteratingRLW.discardLiteralWords.

Doc from com.googlecode.javaewah.IteratingRLW.discardLiteralWords.

Discard x literal words (assumes that there is no running word)

Parameters
x:long

the number of words to discard

Annotations
@Override
discardRunningWordsback to summary
public void discardRunningWords()

Implements com.googlecode.javaewah.IteratingRLW.discardRunningWords.

Doc from com.googlecode.javaewah.IteratingRLW.discardRunningWords.

Discard all running words

Annotations
@Override
getLiteralWordAtback to summary
public long getLiteralWordAt(int index)

Implements com.googlecode.javaewah.IteratingRLW.getLiteralWordAt.

Get the nth literal word for the current running length word

Parameters
index:int

zero based index

Returns:long

the literal word

Annotations
@Override
getNumberOfLiteralWordsback to summary
public int getNumberOfLiteralWords()

Implements com.googlecode.javaewah.IteratingRLW.getNumberOfLiteralWords.

Gets the number of literal words for the current running length word.

Returns:int

the number of literal words

Annotations
@Override
getRunningBitback to summary
public boolean getRunningBit()

Implements com.googlecode.javaewah.IteratingRLW.getRunningBit.

Gets the running bit.

Returns:boolean

the running bit

Annotations
@Override
getRunningLengthback to summary
public long getRunningLength()

Implements com.googlecode.javaewah.IteratingRLW.getRunningLength.

Gets the running length.

Returns:long

the running length

Annotations
@Override
nextback to summary
public boolean next()

Implements com.googlecode.javaewah.IteratingRLW.next.

Move to the next RunningLengthWord

Returns:boolean

whether the move was possible

Annotations
@Override
sizeback to summary
public long size()

Implements com.googlecode.javaewah.IteratingRLW.size.

Size in uncompressed words of the current running length word.

Returns:long

the size

Annotations
@Override