Top Description Fields Constructors Methods
com.googlecode.javaewah32

public final Class RunningLengthWord32

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

Mostly for internal use.
Author
Daniel Lemire
Since
0.5.0

Field Summary

Modifier and TypeField and Description
pack-priv final Buffer32
buffer

The array of words.

public static final int
LARGEST_LITERAL_COUNT

largest number of literal words in a run.

public static final int
LARGEST_RUNNING_LENGTH_COUNT

largest number of clean words in a run

private static final int
private static final int
private static final int
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 int
private static final int

Constructor Summary

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

Instantiates a new running length word.

Method Summary

Modifier and TypeMethod and Description
public RunningLengthWord32
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 Buffer32 buffer, final int position)

public boolean

Returns:

the running bit
getRunningBit
()

Gets the running bit.

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

public int

Returns:

the running length
getRunningLength
()

Gets the running length.

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

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

Sets the number of literal words.

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

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

Sets the running bit.

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

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

Sets the running length.

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

public int

Returns:

the int
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 Buffer32 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 int 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 int NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT
NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNTback to summary
private static final int 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 int RUNNING_LENGTH_PLUS_RUNNING_BIT
SHIFTED_LARGEST_RUNNING_LENGTH_COUNTback to summary
private static final int SHIFTED_LARGEST_RUNNING_LENGTH_COUNT

Constructor Detail

RunningLengthWord32back to summary
pack-priv RunningLengthWord32(final Buffer32 buffer, final int p)

Instantiates a new running length word.

Parameters
buffer:Buffer32

the buffer

p:int

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

Method Detail

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

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 Buffer32 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 Buffer32 buffer, final int position)
getRunningLengthback to summary
public int getRunningLength()

Gets the running length.

Returns:int

the running length

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

Sets the number of literal words.

Parameters
number:int

the new number of literal words

setNumberOfLiteralWordsback to summary
pack-priv static void setNumberOfLiteralWords(final Buffer32 buffer, final int position, final int 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 Buffer32 buffer, final int position, final boolean b)
setRunningLengthback to summary
public void setRunningLength(final int number)

Sets the running length.

Parameters
number:int

the new running length

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

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

Returns:int

the int

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