compress
Class Huff

java.lang.Object
  |
  +--compress.CompressAlgo
        |
        +--compress.Huff

public class Huff
extends CompressAlgo

A concrete CompressAlgo for Huffman coding

Author:
Chad Cook, Richa Dubey, Prashant Singh

Field Summary
static Huff Singleton
           
 
Constructor Summary
private Huff()
           
 
Method Summary
 java.io.File decode(java.io.File fileIn)
          Decodes fileIn.
 java.io.File encode(java.io.File fileIn)
          Encodes fileIn using Huffman coding and gives back the encoded file with a .ccc attatched to the name.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

Singleton

public static final Huff Singleton
Constructor Detail

Huff

private Huff()
Method Detail

encode

public java.io.File encode(java.io.File fileIn)
Encodes fileIn using Huffman coding and gives back the encoded file with a .ccc attatched to the name.
Overrides:
encode in class CompressAlgo
Parameters:
File - The file to be encoded
Returns:
The encoded file.

decode

public java.io.File decode(java.io.File fileIn)
Decodes fileIn. fileIn is assumed to be Huffman encoded, starting with a list of alternating letters and frequencies from the original file.
Overrides:
decode in class CompressAlgo
Parameters:
File - The Huffman encoded file.
Returns:
The decoded file.