|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.Compact7BitString.StaticDictionary
public static final class Compact7BitString.StaticDictionary
Immutable static dictionary to improve in-memory compression. It is not permitted to serialise as-is a Compact7BitString that is using one of these so as to prevent decompression errors/ambiguities.
| Field Summary | |
|---|---|
private java.util.concurrent.ConcurrentMap<java.lang.String,Tuple.Pair<java.util.concurrent.atomic.AtomicInteger,java.util.concurrent.atomic.AtomicInteger>> |
_uncompEarlyTokens
Thread-safe map from text of uncompressed token (close to start of input) to count and summed-position of the token; non-null iff LOG_STATS is true. |
private static int |
FIRST_VIRTUAL_OFFSET
First (numerically most positive) "virtual" offset used by the static dictionary; strictly negative. |
static int |
MAX_TOKENS
The maximum number of simple tokens for the static dictionary; strictly positive. |
java.lang.String |
name
The name of this dictionary, never null. |
java.util.List<java.lang.String> |
tokens
The immutable (non-empty) list of unique, best-first tokens; never null nor empty. |
private java.util.HashMap<java.lang.String,java.lang.Integer> |
virtualOffsets
Virtual offsets of tokens in static dictionary; never null nor empty. |
| Constructor Summary | |
|---|---|
Compact7BitString.StaticDictionary(java.lang.String name,
java.util.List<java.lang.String> tokens)
Create an instance of a static dictionary. |
|
| Method Summary | |
|---|---|
void |
dumpStats(java.io.PrintStream out)
Dump stats (if any) to the given (non-null) stream. |
boolean |
equals(java.lang.Object obj)
Only equal if all non-stats fields are. |
int |
hashCode()
We don't expect to have to distinguish other than on name in practice, but we use the table size too. |
boolean |
isStatsEnabled()
Returns true if stats-collecting is enabled. |
void |
resetStats()
Resets the stats (if any) being recorded for this dictionary. |
java.lang.String |
toString()
Human-readable summary: including the dictionary name; never null. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_TOKENS
private static final int FIRST_VIRTUAL_OFFSET
public final java.lang.String name
public final java.util.List<java.lang.String> tokens
private final java.util.HashMap<java.lang.String,java.lang.Integer> virtualOffsets
Kept private because it is faster to keep it unwrapped and mutable.
private final java.util.concurrent.ConcurrentMap<java.lang.String,Tuple.Pair<java.util.concurrent.atomic.AtomicInteger,java.util.concurrent.atomic.AtomicInteger>> _uncompEarlyTokens
This map is for early tokens of length 2 or more characters, ie that we might be able to compress better using a static dictionary.
This is kept for statistical purposes.
Only the first occurrence of each token in each compress/input is counted.
| Constructor Detail |
|---|
public Compact7BitString.StaticDictionary(java.lang.String name,
java.util.List<java.lang.String> tokens)
name - dictionary name; must not be nulltokens - unique tokens, non-null, best first, each of length > 1,
non-empty, no longer than MAX_TOKENS| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isStatsEnabled()
public void resetStats()
public void dumpStats(java.io.PrintStream out)
out - never null
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||