public final class Parameters
extends java.lang.Object
compressor
.Modifier and Type | Class and Description |
---|---|
static class |
Parameters.Builder
Builder for
Parameters instances. |
Modifier and Type | Field and Description |
---|---|
private boolean |
lazyMatching |
private int |
lazyThreshold |
private int |
maxBackReferenceLength |
private int |
maxCandidates |
private int |
maxLiteralLength |
private int |
maxOffset |
private int |
minBackReferenceLength |
private int |
niceBackReferenceLength |
static int |
TRUE_MIN_BACK_REFERENCE_LENGTH
The hard-coded absolute minimal length of a back-reference.
|
private int |
windowSize |
Modifier | Constructor and Description |
---|---|
private |
Parameters(int windowSize,
int minBackReferenceLength,
int maxBackReferenceLength,
int maxOffset,
int maxLiteralLength,
int niceBackReferenceLength,
int maxCandidates,
boolean lazyMatching,
int lazyThreshold) |
Modifier and Type | Method and Description |
---|---|
static Parameters.Builder |
builder(int windowSize)
Initializes the builder for the compressor's parameters with a
minBackReferenceLength of 3 and max*Length
equal to windowSize - 1 . |
boolean |
getLazyMatching()
Gets whether to perform lazy matching.
|
int |
getLazyMatchingThreshold()
Gets the threshold for lazy matching.
|
int |
getMaxBackReferenceLength()
Gets the maximal length of a back-reference found.
|
int |
getMaxCandidates()
Gets the maximum number of back-reference candidates to consider.
|
int |
getMaxLiteralLength()
Gets the maximal length of a literal block.
|
int |
getMaxOffset()
Gets the maximal offset of a back-reference found.
|
int |
getMinBackReferenceLength()
Gets the minimal length of a back-reference found.
|
int |
getNiceBackReferenceLength()
Gets the length of a back-reference that is considered nice enough to stop searching for longer ones.
|
int |
getWindowSize()
Gets the size of the sliding window - this determines the
maximum offset a back-reference can take.
|
private static boolean |
isPowerOfTwo(int x) |
public static final int TRUE_MIN_BACK_REFERENCE_LENGTH
private final int windowSize
private final int minBackReferenceLength
private final int maxBackReferenceLength
private final int maxOffset
private final int maxLiteralLength
private final int niceBackReferenceLength
private final int maxCandidates
private final int lazyThreshold
private final boolean lazyMatching
private Parameters(int windowSize, int minBackReferenceLength, int maxBackReferenceLength, int maxOffset, int maxLiteralLength, int niceBackReferenceLength, int maxCandidates, boolean lazyMatching, int lazyThreshold)
public static Parameters.Builder builder(int windowSize)
minBackReferenceLength
of 3 and max*Length
equal to windowSize - 1
.
It is recommended to not use this method directly but rather
tune a pre-configured builder created by a format specific
factory like SnappyCompressorOutputStream.createParameterBuilder(int)
.
windowSize
- the size of the sliding window - this
determines the maximum offset a back-reference can take. Must
be a power of two.java.lang.IllegalArgumentException
- if windowSize is not a power of two.public int getWindowSize()
public int getMinBackReferenceLength()
public int getMaxBackReferenceLength()
public int getMaxOffset()
public int getMaxLiteralLength()
public int getNiceBackReferenceLength()
public int getMaxCandidates()
public boolean getLazyMatching()
public int getLazyMatchingThreshold()
private static final boolean isPowerOfTwo(int x)