Package com.googlecode.javaewah
Class RunningLengthWord
java.lang.Object
com.googlecode.javaewah.RunningLengthWord
- All Implemented Interfaces:
Cloneable
Mostly for internal use.
- Since:
- 0.1.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Buffer
The array of words.static final int
largest number of literal words in a run.static final long
largest number of clean words in a runprivate static final int
private static final long
private static final long
(package private) int
The position in array.static final int
number of bits dedicated to marking of the running length of clean wordsprivate static final long
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionRunningLengthWord
(Buffer buffer, int p) Instantiates a new running length word. -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
Gets the number of literal words.(package private) static int
getNumberOfLiteralWords
(Buffer buffer, int position) boolean
Gets the running bit.(package private) static boolean
getRunningBit
(Buffer buffer, int position) long
Gets the running length.(package private) static long
getRunningLength
(Buffer buffer, int position) void
setNumberOfLiteralWords
(long number) Sets the number of literal words.(package private) static void
setNumberOfLiteralWords
(Buffer buffer, int position, long number) void
setRunningBit
(boolean b) Sets the running bit.(package private) static void
setRunningBit
(Buffer buffer, int position, boolean b) void
setRunningLength
(long number) Sets the running length.(package private) static void
setRunningLength
(Buffer buffer, int position, long number) long
size()
Return the size in uncompressed words represented by this running length word.toString()
-
Field Details
-
buffer
The array of words. -
position
int positionThe position in array. -
RUNNING_LENGTH_BITS
public static final int RUNNING_LENGTH_BITSnumber of bits dedicated to marking of the running length of clean words- See Also:
-
LITERAL_BITS
private static final int LITERAL_BITS- See Also:
-
LARGEST_LITERAL_COUNT
public static final int LARGEST_LITERAL_COUNTlargest number of literal words in a run.- See Also:
-
LARGEST_RUNNING_LENGTH_COUNT
public static final long LARGEST_RUNNING_LENGTH_COUNTlargest number of clean words in a run- See Also:
-
RUNNING_LENGTH_PLUS_RUNNING_BIT
private static final long RUNNING_LENGTH_PLUS_RUNNING_BIT- See Also:
-
SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
private static final long SHIFTED_LARGEST_RUNNING_LENGTH_COUNT- See Also:
-
NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT
private static final long NOT_RUNNING_LENGTH_PLUS_RUNNING_BIT- See Also:
-
NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNT
private static final long NOT_SHIFTED_LARGEST_RUNNING_LENGTH_COUNT- See Also:
-
-
Constructor Details
-
RunningLengthWord
RunningLengthWord(Buffer buffer, int p) Instantiates a new running length word.- Parameters:
buffer
- the bufferp
- position in the buffer where the running length word is located.
-
-
Method Details
-
getNumberOfLiteralWords
public int getNumberOfLiteralWords()Gets the number of literal words.- Returns:
- the number of literal words
-
getNumberOfLiteralWords
-
getRunningBit
public boolean getRunningBit()Gets the running bit.- Returns:
- the running bit
-
getRunningBit
-
getRunningLength
public long getRunningLength()Gets the running length.- Returns:
- the running length
-
getRunningLength
-
setNumberOfLiteralWords
public void setNumberOfLiteralWords(long number) Sets the number of literal words.- Parameters:
number
- the new number of literal words
-
setNumberOfLiteralWords
-
setRunningBit
public void setRunningBit(boolean b) Sets the running bit.- Parameters:
b
- the new running bit
-
setRunningBit
-
setRunningLength
public void setRunningLength(long number) Sets the running length.- Parameters:
number
- the new running length
-
setRunningLength
-
size
public long size()Return the size in uncompressed words represented by this running length word.- Returns:
- the size
-
toString
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-