|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.rgw.compress.HuffmanTree
public class HuffmanTree
Field Summary | |
---|---|
int[] |
freq
|
static byte[] |
TextDeutsch
Standard table for German text |
Constructor Summary | |
---|---|
HuffmanTree()
|
|
HuffmanTree(byte[] source)
create a Huffman Tree from a given source. |
|
HuffmanTree(int[] frequencyTable)
create a Huffman Tree from a frequency table (which must be an Integer Array of exactly 255 elements) |
Method Summary | |
---|---|
ch.rgw.compress.HuffmanTree.Node |
build(int[] table)
Build a tree from a frequency table. |
static boolean |
checkCompacter()
|
static int[] |
constructTable(byte[] source)
constructs a frequency table from an array of bytes |
java.io.InputStream |
constructTable(java.io.InputStream source,
boolean copy)
Construct a frequency table from an InputStream. |
static int[] |
constructTable(java.io.RandomAccessFile file)
constructs a frequency table from a file |
static boolean |
CreateStandardTableFromStream(java.lang.String name,
java.io.InputStream in)
compute a frequency table from an InputStream and save a compacted representation of this table in the system preferences. |
static void |
dumpTable(int[] table)
|
ch.rgw.compress.HuffmanTree.Node |
getRootNode()
|
int[] |
getTable()
|
static int[] |
loadTable(java.io.InputStream in)
Reloads a frequency table as saved by saveTable |
boolean |
saveTable(java.io.OutputStream out)
Creates a compacted form of the actual frequency table and saves it into an OutputStream. |
static int[] |
useStandardTable(java.lang.String name)
Import a compaced frequency table from the system preferences (In windows from the registry HKLM/JavaSoft/Prefs/ch/rgw/tools/Compress/StandardTables, in Linux from ~/.prefs) |
static int[] |
useTable(byte[] in)
imports a compacted predefined Table |
static java.lang.String |
Version()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int[] freq
public static byte[] TextDeutsch
Constructor Detail |
---|
public HuffmanTree()
public HuffmanTree(byte[] source)
source
- an arbitrary sequence of bytes.public HuffmanTree(int[] frequencyTable)
frequencyTable
- Method Detail |
---|
public static java.lang.String Version()
public ch.rgw.compress.HuffmanTree.Node build(int[] table)
table
- a field of TABLESIZE ints indicating the frequency od each byte
public static int[] constructTable(byte[] source)
source
- the array to construct the table frompublic static int[] constructTable(java.io.RandomAccessFile file)
public java.io.InputStream constructTable(java.io.InputStream source, boolean copy)
source
- the Input Stream
public boolean saveTable(java.io.OutputStream out)
public static int[] loadTable(java.io.InputStream in)
public static int[] useTable(byte[] in)
in
-
public static int[] useStandardTable(java.lang.String name)
name
- Name of the table in the registry. If no table with this name is found, the
default table (TextDeutsch) is returned.
public static boolean CreateStandardTableFromStream(java.lang.String name, java.io.InputStream in) throws java.lang.Exception
name
- name to give the table.in
- InputStream
java.lang.Exception
public ch.rgw.compress.HuffmanTree.Node getRootNode()
public int[] getTable()
public static void dumpTable(int[] table)
public static boolean checkCompacter()
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |