VALUE - the value that wants to be encoded.public final class HuffmanTree<VALUE> extends Object
Multiset and returns
huffman codes getHuffmanCodes(). Features generic and object tree
representation which uses lots of ram and will be replaced with an array
based version soon.| Constructor and Description |
|---|
HuffmanTree() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(com.google.common.collect.Multiset<VALUE> multiSet)
Bulk inserts the given multiset into this huffman tree.
|
VALUE |
decode(de.jungblut.math.sparse.SparseBitVector vector)
Decodes a given vector.
|
int |
getCardinality() |
Map<VALUE,de.jungblut.math.sparse.SparseBitVector> |
getHuffmanCodes()
Bulk returns all generated Huffman codes as a bit vector representation.
|
public void addAll(com.google.common.collect.Multiset<VALUE> multiSet)
multiSet - a multiset that contains value mappings to their frequency.public Map<VALUE,de.jungblut.math.sparse.SparseBitVector> getHuffmanCodes()
public VALUE decode(de.jungblut.math.sparse.SparseBitVector vector)
vector - the bit vector to decode.public int getCardinality()
Copyright © 2016. All rights reserved.