Top Description Fields Constructors Methods
com.googlecode.javaewah

public final Class RunningLengthWord

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

Mostly for internal use.
Author
Daniel Lemire
Since
0.1.0

Field Summary

Modifier and TypeField and Description
pack-priv final Buffer
buffer

The array of words.

public static final int
LARGEST_LITERAL_COUNT

largest number of literal words in a run.

public static final long
LARGEST_RUNNING_LENGTH_COUNT

largest number of clean words in a run

private static final int
private static final long
private static final long
pack-priv int
position

The position in array.

public static final int
RUNNING_LENGTH_BITS

number of bits dedicated to marking of the running length of clean words

private static final long
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
RunningLengthWord(final Buffer
the buffer
buffer
,
final int
position in the buffer where the running length word is located.
p
)

Instantiates a new running length word.

Method Summary

Modifier and TypeMethod and Description
public RunningLengthWord
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public int

Returns:

the number of literal words
getNumberOfLiteralWords
()

Gets the number of literal words.

pack-priv static int
getNumberOfLiteralWords(final Buffer buffer, final int position)

public boolean

Returns:

the running bit
getRunningBit
()

Gets the running bit.

pack-priv static boolean
getRunningBit(final Buffer buffer, final int position)

public long

Returns:

the running length
getRunningLength
()

Gets the running length.

pack-priv static long
getRunningLength(final Buffer buffer, final int position)

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

Sets the number of literal words.

pack-priv static void
setNumberOfLiteralWords(final Buffer buffer, final int position, final long number)

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

Sets the running bit.

pack-priv static void
setRunningBit(final Buffer buffer, final int position, final boolean b)

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

Sets the running length.

pack-priv static void
setRunningLength(final Buffer buffer, final int position, final long number)

public long

Returns:

the size
size
()

Return the size in uncompressed words represented by this running length word.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
pack-priv final Buffer buffer

The array of words.

LARGEST_LITERAL_COUNTback to summary
public static final int LARGEST_LITERAL_COUNT

largest number of literal words in a run.

LARGEST_RUNNING_LENGTH_COUNTback to summary
public static final long LARGEST_RUNNING_LENGTH_COUNT

largest number of clean words in a run

LITERAL_BITSback to summary
private static final int LITERAL_BITS
NOT_RUNNING_LENGTH_PLUS_RUNNING_BITback to summary
private static final long NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT
NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNTback to summary
private static final long NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
positionback to summary
pack-priv int position

The position in array.

RUNNING_LENGTH_BITSback to summary
public static final int RUNNING_LENGTH_BITS

number of bits dedicated to marking of the running length of clean words

RUNNING_LENGTH_PLUS_RUNNING_BITback to summary
private static final long RUNNING_LENGTH_PLUS_RUNNING_BIT
SHIFTED_LARGEST_RUNNING_LENGTH_COUNTback to summary
private static final long SHIFTED_LARGEST_RUNNING_LENGTH_COUNT

Constructor Detail

RunningLengthWordback to summary
pack-priv RunningLengthWord(final Buffer buffer, final int p)

Instantiates a new running length word.

Parameters
buffer:Buffer

the buffer

p:int

position in the buffer where the running length word is located.

Method Detail

cloneback to summary
public RunningLengthWord 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:RunningLengthWord

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.
getNumberOfLiteralWordsback to summary
public int getNumberOfLiteralWords()

Gets the number of literal words.

Returns:int

the number of literal words

getNumberOfLiteralWordsback to summary
pack-priv static int getNumberOfLiteralWords(final Buffer buffer, final int position)
getRunningBitback to summary
public boolean getRunningBit()

Gets the running bit.

Returns:boolean

the running bit

getRunningBitback to summary
pack-priv static boolean getRunningBit(final Buffer buffer, final int position)
getRunningLengthback to summary
public long getRunningLength()

Gets the running length.

Returns:long

the running length

getRunningLengthback to summary
pack-priv static long getRunningLength(final Buffer buffer, final int position)
setNumberOfLiteralWordsback to summary
public void setNumberOfLiteralWords(final long number)

Sets the number of literal words.

Parameters
number:long

the new number of literal words

setNumberOfLiteralWordsback to summary
pack-priv static void setNumberOfLiteralWords(final Buffer buffer, final int position, final long number)
setRunningBitback to summary
public void setRunningBit(final boolean b)

Sets the running bit.

Parameters
b:boolean

the new running bit

setRunningBitback to summary
pack-priv static void setRunningBit(final Buffer buffer, final int position, final boolean b)
setRunningLengthback to summary
public void setRunningLength(final long number)

Sets the running length.

Parameters
number:long

the new running length

setRunningLengthback to summary
pack-priv static void setRunningLength(final Buffer buffer, final int position, final long number)
sizeback to summary
public long size()

Return the size in uncompressed words represented by this running length word.

Returns:long

the size

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