Package com.googlecode.javaewah32
Class RunningLengthWord32
- java.lang.Object
-
- com.googlecode.javaewah32.RunningLengthWord32
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class RunningLengthWord32 extends java.lang.Object implements java.lang.Cloneable
Mostly for internal use.- Since:
- 0.5.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Buffer32
buffer
The array of words.static int
LARGEST_LITERAL_COUNT
largest number of literal words in a run.static int
LARGEST_RUNNING_LENGTH_COUNT
largest number of clean words in a runprivate static int
LITERAL_BITS
private static int
NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT
private static int
NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
(package private) int
position
The position in array.static int
RUNNING_LENGTH_BITS
number of bits dedicated to marking of the running length of clean wordsprivate static int
RUNNING_LENGTH_PLUS_RUNNING_BIT
private static int
SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
-
Constructor Summary
Constructors Constructor Description RunningLengthWord32(Buffer32 buffer, int p)
Instantiates a new running length word.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RunningLengthWord32
clone()
int
getNumberOfLiteralWords()
Gets the number of literal words.(package private) static int
getNumberOfLiteralWords(Buffer32 buffer, int position)
boolean
getRunningBit()
Gets the running bit.(package private) static boolean
getRunningBit(Buffer32 buffer, int position)
int
getRunningLength()
Gets the running length.(package private) static int
getRunningLength(Buffer32 buffer, int position)
void
setNumberOfLiteralWords(int number)
Sets the number of literal words.(package private) static void
setNumberOfLiteralWords(Buffer32 buffer, int position, int number)
void
setRunningBit(boolean b)
Sets the running bit.(package private) static void
setRunningBit(Buffer32 buffer, int position, boolean b)
void
setRunningLength(int number)
Sets the running length.(package private) static void
setRunningLength(Buffer32 buffer, int position, int number)
int
size()
Return the size in uncompressed words represented by this running length word.java.lang.String
toString()
-
-
-
Field Detail
-
buffer
final Buffer32 buffer
The array of words.
-
position
int position
The position in array.
-
RUNNING_LENGTH_BITS
public static final int RUNNING_LENGTH_BITS
number of bits dedicated to marking of the running length of clean words- See Also:
- Constant Field Values
-
LITERAL_BITS
private static final int LITERAL_BITS
- See Also:
- Constant Field Values
-
LARGEST_LITERAL_COUNT
public static final int LARGEST_LITERAL_COUNT
largest number of literal words in a run.- See Also:
- Constant Field Values
-
LARGEST_RUNNING_LENGTH_COUNT
public static final int LARGEST_RUNNING_LENGTH_COUNT
largest number of clean words in a run- See Also:
- Constant Field Values
-
RUNNING_LENGTH_PLUS_RUNNING_BIT
private static final int RUNNING_LENGTH_PLUS_RUNNING_BIT
- See Also:
- Constant Field Values
-
SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
private static final int SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
- See Also:
- Constant Field Values
-
NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT
private static final int NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT
- See Also:
- Constant Field Values
-
NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
private static final int NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RunningLengthWord32
RunningLengthWord32(Buffer32 buffer, int p)
Instantiates a new running length word.- Parameters:
buffer
- the bufferp
- position in the array where the running length word is located.
-
-
Method Detail
-
getNumberOfLiteralWords
public int getNumberOfLiteralWords()
Gets the number of literal words.- Returns:
- the number of literal words
-
getNumberOfLiteralWords
static int getNumberOfLiteralWords(Buffer32 buffer, int position)
-
getRunningBit
public boolean getRunningBit()
Gets the running bit.- Returns:
- the running bit
-
getRunningBit
static boolean getRunningBit(Buffer32 buffer, int position)
-
getRunningLength
public int getRunningLength()
Gets the running length.- Returns:
- the running length
-
getRunningLength
static int getRunningLength(Buffer32 buffer, int position)
-
setNumberOfLiteralWords
public void setNumberOfLiteralWords(int number)
Sets the number of literal words.- Parameters:
number
- the new number of literal words
-
setNumberOfLiteralWords
static void setNumberOfLiteralWords(Buffer32 buffer, int position, int number)
-
setRunningBit
public void setRunningBit(boolean b)
Sets the running bit.- Parameters:
b
- the new running bit
-
setRunningBit
static void setRunningBit(Buffer32 buffer, int position, boolean b)
-
setRunningLength
public void setRunningLength(int number)
Sets the running length.- Parameters:
number
- the new running length
-
setRunningLength
static void setRunningLength(Buffer32 buffer, int position, int number)
-
size
public int size()
Return the size in uncompressed words represented by this running length word.- Returns:
- the int
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public RunningLengthWord32 clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-