Top Description Fields Constructors Methods
com.googlecode.javaewah32

public final Class IteratingBufferedRunningLengthWord32

extends Object
implements IteratingRLW32, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.googlecode.javaewah32.IteratingRLW32

Mostly for internal use. Similar to BufferedRunningLengthWord32, but automatically advances to the next BufferedRunningLengthWord32 as words are discarded.
Author
Daniel Lemire and David McIntosh
Since
0.5.0

Field Summary

Modifier and TypeField and Description
private BufferedRunningLengthWord32
private final Buffer32
private EWAHIterator32
private int

Constructor Summary

AccessConstructor and Description
public
IteratingBufferedRunningLengthWord32(final EWAHIterator32
iterator
iterator
)

Instantiates a new iterating buffered running length word.

public
IteratingBufferedRunningLengthWord32(final EWAHCompressedBitmap32
over which we want to iterate
bitmap
)

Instantiates a new iterating buffered running length word.

Method Summary

Modifier and TypeMethod and Description
public IteratingBufferedRunningLengthWord32
clone()

Overrides java.lang.Object.clone.

Implements com.googlecode.javaewah32.IteratingRLW32.clone.

Creates and returns a copy of this object.

public void
discardFirstWords(int
the x
x
)

Implements com.googlecode.javaewah32.IteratingRLW32.discardFirstWords.

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

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

Implements com.googlecode.javaewah32.IteratingRLW32.discardLiteralWords.

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

public void
public int

Returns:

how many written
discharge
(BitmapStorage32
target for writes
container
,
int
maximal number of writes
max
)

Write out up to max words, returns how many were written

public void
discharge(BitmapStorage32
target for writes
container
)

Write out the remaining words

protected static void
discharge(final BufferedRunningLengthWord32
the initial word
initialWord
,
final EWAHIterator32
the iterator
iterator
,
final BitmapStorage32
the container
container
)

For internal use.

public void
dischargeAsEmpty(BitmapStorage32
target for writes
container
)

Write out the remain words, transforming them to zeroes.

public int

Returns:

how many written
dischargeNegated
(BitmapStorage32
target for writes
container
,
int
maximal number of writes
max
)

Write out up to max words (negated), returns how many were written

public int

Returns:

the literal word
getLiteralWordAt
(int
zero based index
index
)

Implements com.googlecode.javaewah32.IteratingRLW32.getLiteralWordAt.

Get the nth literal word for the current running length word

public int

Returns:

the number of literal words
getNumberOfLiteralWords
()

Implements com.googlecode.javaewah32.IteratingRLW32.getNumberOfLiteralWords.

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

public boolean

Returns:

the running bit
getRunningBit
()

Implements com.googlecode.javaewah32.IteratingRLW32.getRunningBit.

Gets the running bit.

public int

Returns:

the running length
getRunningLength
()

Implements com.googlecode.javaewah32.IteratingRLW32.getRunningLength.

Gets the running length.

public boolean

Returns:

whether the move was possible
next
()

Implements com.googlecode.javaewah32.IteratingRLW32.next.

Move to the next RunningLengthWord

public int

Returns:

the int
size
()

Implements com.googlecode.javaewah32.IteratingRLW32.size.

Size in uncompressed words of the current running length word.

public void
writeLiteralWords(int
number of words to be written
numWords
,
BitmapStorage32
where we write the data
container
)

write the first N literal words to the target bitmap.

public void
writeNegatedLiteralWords(int
number of words to be written
numWords
,
BitmapStorage32
where we write the data
container
)

write the first N literal words (negated) to the target bitmap.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

brlwback to summary
private BufferedRunningLengthWord32 brlw
bufferback to summary
private final Buffer32 buffer
iteratorback to summary
private EWAHIterator32 iterator
literalWordStartPositionback to summary
private int literalWordStartPosition

Constructor Detail

IteratingBufferedRunningLengthWord32back to summary
public IteratingBufferedRunningLengthWord32(final EWAHIterator32 iterator)

Instantiates a new iterating buffered running length word.

Parameters
iterator:EWAHIterator32

iterator

IteratingBufferedRunningLengthWord32back to summary
public IteratingBufferedRunningLengthWord32(final EWAHCompressedBitmap32 bitmap)

Instantiates a new iterating buffered running length word.

Parameters
bitmap:EWAHCompressedBitmap32

over which we want to iterate

Method Detail

cloneback to summary
public IteratingBufferedRunningLengthWord32 clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Implements com.googlecode.javaewah32.IteratingRLW32.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:IteratingBufferedRunningLengthWord32

Doc from com.googlecode.javaewah32.IteratingRLW32.clone.

a copy of the iterator

Annotations
@Override
Exceptions
CloneNotSupportedException:

Doc from com.googlecode.javaewah32.IteratingRLW32.clone.

this should not be thrown in theory

discardFirstWordsback to summary
public void discardFirstWords(int x)

Implements com.googlecode.javaewah32.IteratingRLW32.discardFirstWords.

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

Parameters
x:int

the x

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

Implements com.googlecode.javaewah32.IteratingRLW32.discardLiteralWords.

Doc from com.googlecode.javaewah32.IteratingRLW32.discardLiteralWords.

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

Parameters
x:int

the number of words to discard

Annotations
@Override
discardRunningWordsback to summary
public void discardRunningWords()

Implements com.googlecode.javaewah32.IteratingRLW32.discardRunningWords.

Doc from com.googlecode.javaewah32.IteratingRLW32.discardRunningWords.

Discard all running words

Annotations
@Override
dischargeback to summary
public int discharge(BitmapStorage32 container, int max)

Write out up to max words, returns how many were written

Parameters
container:BitmapStorage32

target for writes

max:int

maximal number of writes

Returns:int

how many written

dischargeback to summary
public void discharge(BitmapStorage32 container)

Write out the remaining words

Parameters
container:BitmapStorage32

target for writes

dischargeback to summary
protected static void discharge(final BufferedRunningLengthWord32 initialWord, final EWAHIterator32 iterator, final BitmapStorage32 container)

For internal use. (One could use the non-static discharge method instead, but we expect them to be slower.)

Parameters
initialWord:BufferedRunningLengthWord32

the initial word

iterator:EWAHIterator32

the iterator

container:BitmapStorage32

the container

dischargeAsEmptyback to summary
public void dischargeAsEmpty(BitmapStorage32 container)

Write out the remain words, transforming them to zeroes.

Parameters
container:BitmapStorage32

target for writes

dischargeNegatedback to summary
public int dischargeNegated(BitmapStorage32 container, int max)

Write out up to max words (negated), returns how many were written

Parameters
container:BitmapStorage32

target for writes

max:int

maximal number of writes

Returns:int

how many written

getLiteralWordAtback to summary
public int getLiteralWordAt(int index)

Implements com.googlecode.javaewah32.IteratingRLW32.getLiteralWordAt.

Get the nth literal word for the current running length word

Parameters
index:int

zero based index

Returns:int

the literal word

Annotations
@Override
getNumberOfLiteralWordsback to summary
public int getNumberOfLiteralWords()

Implements com.googlecode.javaewah32.IteratingRLW32.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.javaewah32.IteratingRLW32.getRunningBit.

Gets the running bit.

Returns:boolean

the running bit

Annotations
@Override
getRunningLengthback to summary
public int getRunningLength()

Implements com.googlecode.javaewah32.IteratingRLW32.getRunningLength.

Gets the running length.

Returns:int

the running length

Annotations
@Override
nextback to summary
public boolean next()

Implements com.googlecode.javaewah32.IteratingRLW32.next.

Move to the next RunningLengthWord

Returns:boolean

whether the move was possible

Annotations
@Override
sizeback to summary
public int size()

Implements com.googlecode.javaewah32.IteratingRLW32.size.

Size in uncompressed words of the current running length word.

Returns:int

the int

Annotations
@Override
writeLiteralWordsback to summary
public void writeLiteralWords(int numWords, BitmapStorage32 container)

write the first N literal words to the target bitmap. Does not discard the words or perform iteration.

Parameters
numWords:int

number of words to be written

container:BitmapStorage32

where we write the data

writeNegatedLiteralWordsback to summary
public void writeNegatedLiteralWords(int numWords, BitmapStorage32 container)

write the first N literal words (negated) to the target bitmap. Does not discard the words or perform iteration.

Parameters
numWords:int

number of words to be written

container:BitmapStorage32

where we write the data