Package com.googlecode.javaewah
Class BufferedRunningLengthWord
java.lang.Object
com.googlecode.javaewah.BufferedRunningLengthWord
- All Implemented Interfaces:
Cloneable
Mostly for internal use. Similar to RunningLengthWord, but can be modified
without access to the array, and has faster access.
- Since:
- 0.1.0
- Author:
- Daniel Lemire
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
how many literal words have we read so far?protected int
The Number of literal words.protected boolean
The Running bit.protected long
The Running length. -
Constructor Summary
ConstructorsConstructorDescriptionBufferedRunningLengthWord(long a)
Instantiates a new buffered running length word.Instantiates a new buffered running length word. -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
discardFirstWords(long x)
Discard first words.int
Gets the number of literal words.boolean
Gets the running bit.long
Gets the running length.void
reset(long a)
Reset the values using the provided word.void
reset(RunningLengthWord rlw)
Reset the values of this running length word so that it has the same values as the other running length word.void
setNumberOfLiteralWords(int number)
Sets the number of literal words.void
setRunningBit(boolean b)
Sets the running bit.void
setRunningLength(long number)
Sets the running length.long
size()
Size in uncompressed words.toString()
-
Field Details
-
literalWordOffset
protected int literalWordOffsethow many literal words have we read so far? -
numberOfLiteralWords
protected int numberOfLiteralWordsThe Number of literal words. -
runningBit
protected boolean runningBitThe Running bit. -
runningLength
protected long runningLengthThe Running length.
-
-
Constructor Details
-
BufferedRunningLengthWord
public BufferedRunningLengthWord(long a)Instantiates a new buffered running length word.- Parameters:
a
- the word
-
BufferedRunningLengthWord
Instantiates a new buffered running length word.- Parameters:
rlw
- the rlw
-
-
Method Details
-
discardFirstWords
public void discardFirstWords(long x)Discard first words.- Parameters:
x
- the x
-
getNumberOfLiteralWords
public int getNumberOfLiteralWords()Gets the number of literal words.- Returns:
- the number of literal words
-
getRunningBit
public boolean getRunningBit()Gets the running bit.- Returns:
- the running bit
-
getRunningLength
public long getRunningLength()Gets the running length.- Returns:
- the running length
-
reset
public void reset(long a)Reset the values using the provided word.- Parameters:
a
- the word
-
reset
Reset the values of this running length word so that it has the same values as the other running length word.- Parameters:
rlw
- the other running length word
-
setNumberOfLiteralWords
public void setNumberOfLiteralWords(int number)Sets the number of literal words.- Parameters:
number
- the new number of literal words
-
setRunningBit
public void setRunningBit(boolean b)Sets the running bit.- Parameters:
b
- the new running bit
-
setRunningLength
public void setRunningLength(long number)Sets the running length.- Parameters:
number
- the new running length
-
size
public long size()Size in uncompressed words.- Returns:
- the long
-
toString
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-