Top Description Fields Constructors Methods
com.googlecode.javaewah

public final Class BufferedRunningLengthWord

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable

Mostly for internal use. Similar to RunningLengthWord, but can be modified without access to the array, and has faster access.
Author
Daniel Lemire
Since
0.1.0

Field Summary

Modifier and TypeField and Description
protected int
literalWordOffset

how many literal words have we read so far?

protected int
numberOfLiteralWords

The Number of literal words.

protected boolean
runningBit

The Running bit.

protected long
runningLength

The Running length.

Constructor Summary

AccessConstructor and Description
public
BufferedRunningLengthWord(final long
the word
a
)

Instantiates a new buffered running length word.

public
BufferedRunningLengthWord(final RunningLengthWord
the rlw
rlw
)

Instantiates a new buffered running length word.

Method Summary

Modifier and TypeMethod and Description
public BufferedRunningLengthWord
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public void
discardFirstWords(long
the x
x
)

Discard first words.

public int

Returns:

the number of literal words
getNumberOfLiteralWords
()

Gets the number of literal words.

public boolean

Returns:

the running bit
getRunningBit
()

Gets the running bit.

public long

Returns:

the running length
getRunningLength
()

Gets the running length.

public void
reset(final long
the word
a
)

Reset the values using the provided word.

public void
reset(final RunningLengthWord
the other running length word
rlw
)

Reset the values of this running length word so that it has the same values as the other running length word.

public void
setNumberOfLiteralWords(final int
the new number of literal words
number
)

Sets the number of literal words.

public void
setRunningBit(final boolean
the new running bit
b
)

Sets the running bit.

public void
setRunningLength(final long
the new running length
number
)

Sets the running length.

public long

Returns:

the long
size
()

Size in uncompressed words.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

literalWordOffsetback to summary
protected int literalWordOffset

how many literal words have we read so far?

numberOfLiteralWordsback to summary
protected int numberOfLiteralWords

The Number of literal words.

runningBitback to summary
protected boolean runningBit

The Running bit.

runningLengthback to summary
protected long runningLength

The Running length.

Constructor Detail

BufferedRunningLengthWordback to summary
public BufferedRunningLengthWord(final long a)

Instantiates a new buffered running length word.

Parameters
a:long

the word

BufferedRunningLengthWordback to summary
public BufferedRunningLengthWord(final RunningLengthWord rlw)

Instantiates a new buffered running length word.

Parameters
rlw:RunningLengthWord

the rlw

Method Detail

cloneback to summary
public BufferedRunningLengthWord clone() throws CloneNotSupportedException

Overrides java.lang.Object.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:BufferedRunningLengthWord

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
discardFirstWordsback to summary
public void discardFirstWords(long x)

Discard first words.

Parameters
x:long

the x

getNumberOfLiteralWordsback to summary
public int getNumberOfLiteralWords()

Gets the number of literal words.

Returns:int

the number of literal words

getRunningBitback to summary
public boolean getRunningBit()

Gets the running bit.

Returns:boolean

the running bit

getRunningLengthback to summary
public long getRunningLength()

Gets the running length.

Returns:long

the running length

resetback to summary
public void reset(final long a)

Reset the values using the provided word.

Parameters
a:long

the word

resetback to summary
public void reset(final RunningLengthWord rlw)

Reset the values of this running length word so that it has the same values as the other running length word.

Parameters
rlw:RunningLengthWord

the other running length word

setNumberOfLiteralWordsback to summary
public void setNumberOfLiteralWords(final int number)

Sets the number of literal words.

Parameters
number:int

the new number of literal words

setRunningBitback to summary
public void setRunningBit(final boolean b)

Sets the running bit.

Parameters
b:boolean

the new running bit

setRunningLengthback to summary
public void setRunningLength(final long number)

Sets the running length.

Parameters
number:long

the new running length

sizeback to summary
public long size()

Size in uncompressed words.

Returns:long

the long

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override