CompressionDictionary class
A shared compression dictionary for similar data.
CompressionDictionary maps common strings to short codes, enabling efficient compression for data with repeated patterns.
Constructors
- CompressionDictionary({String name = 'default', int minPatternLength = 2, int maxDictionarySize = 65536})
- Creates a CompressionDictionary.
Properties
-
codes
→ Iterable<
int> -
All codes in the dictionary.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether the dictionary is empty.
no setter
- maxDictionarySize → int
-
Maximum dictionary size (number of entries).
final
- minPatternLength → int
-
Minimum string length to add to the dictionary.
final
- name → String
-
The name/identifier for this dictionary.
final
-
patterns
→ Iterable<
String> -
All patterns in the dictionary.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
The number of entries in the dictionary.
no setter
Methods
-
addPattern(
String pattern) → int - Adds a pattern to the dictionary.
-
clear(
) → void - Clears the dictionary.
-
containsCode(
int code) → bool - Whether the dictionary contains a code.
-
containsPattern(
String pattern) → bool - Whether the dictionary contains a pattern.
-
getCode(
String pattern) → int? - Gets the code for a pattern, or null if not in the dictionary.
-
getPattern(
int code) → String? - Gets the pattern for a code, or null if not in the dictionary.
-
merge(
CompressionDictionary other) → void - Merges another dictionary into this one.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes the dictionary to a map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, dynamic> json) → CompressionDictionary - Deserializes a dictionary from a map.