A* Pathfinding Project  3.1.4
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Enumerations Properties Groups Pages
Huffman Class Reference

Class for encoding strings or byte arrays with Huffman encoding. More...

+ Inheritance diagram for Huffman:
+ Collaboration diagram for Huffman:

Classes

class  Leaf
 Container for Leafs and Nodes within the Huffman Tree
 

Public Member Functions

 Huffman ()
 Constructor – Nothing added to Frequency Table
 
 Huffman (byte[] bInput)
 Constructor – byte[] added to Frequency Table
 
 Huffman (string sInput)
 
void Add (byte b)
 Adds a Byte to the Frequency Table
 
void Add (string s)
 Adds a String to the Frequency Table
 
void Clear ()
 Clears data entered for encoding
 
byte[] Decode (byte[] bInput)
 
void Dispose ()
 
byte[] Encode (out string OutputLog)
 Applies Huffman Encoding to the data entered
 
byte[] Encode ()
 Applies Huffman Encoding to the data entered
 

Private Member Functions

bool BuildTree ()
 Takes Frequency Value and Establishes Parent/Child relationship with Tree Nodes & Leafs
 
bool EncodeTree ()
 Walks up the tree from each Leaf, encoding as it goes.
 
void Init ()
 Populate the Leaf Table (Frequency Table), the Leafs will be turned into Nodes
 

Private Attributes

List< Leaf > HuffmanTree = new List<Leaf>()
 
StringBuilder Log = new StringBuilder()
 
bool LogEnabled = false
 
MemoryStream msInputbytes = new MemoryStream()
 

Detailed Description

Class for encoding strings or byte arrays with Huffman encoding.

Author
Eric Nusbaum (eric@.nosp@m.enus.nosp@m.baum..nosp@m.com)
Since
1.0
Date
05/22/2009

Constructor & Destructor Documentation

Huffman ( )

Constructor – Nothing added to Frequency Table

+ Here is the call graph for this function:

Huffman ( byte[]  bInput)

Constructor – byte[] added to Frequency Table

Parameters
bInput

+ Here is the call graph for this function:

Member Function Documentation

void Add ( byte  b)

Adds a Byte to the Frequency Table

Parameters
b

+ Here is the call graph for this function:

void Add ( string  s)

Adds a String to the Frequency Table

Parameters
s
bool BuildTree ( )
private

Takes Frequency Value and Establishes Parent/Child relationship with Tree Nodes & Leafs

Returns

+ Here is the caller graph for this function:

void Clear ( )

Clears data entered for encoding

byte [] Encode ( out string  OutputLog)

Applies Huffman Encoding to the data entered

Parameters
OutputLogstring – Log of Encoding, which returns the Huffman Tree Information
Returns
byte[] – byte[] containing the encoded data package

+ Here is the call graph for this function:

byte [] Encode ( )

Applies Huffman Encoding to the data entered

Returns
byte[] – byte[] containing the encoded data package

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool EncodeTree ( )
private

Walks up the tree from each Leaf, encoding as it goes.

Returns

+ Here is the caller graph for this function:

void Init ( )
private

Populate the Leaf Table (Frequency Table), the Leafs will be turned into Nodes

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: