LZApplet implements the classical LZ78 compresion algorithm. It reads and writes tokens in form, and can also write tokens in binary.

The implementation is done with a digital search tree stored in a heap; this was adapted from Nelson's The Data Compression Book, although my implementation deals with input one character at a time and returns partial tokens to the caller, which is a more elegant (although less efficient!) interface.

I will also point out the PeeredTextWindow concept. Since the compress and decompress routines are intimately related, it made sense to make them subclasses of a common PeeredTextWindow. When it receives a keypress, it updates the text in its peer, as well.

Tragically, on some systems the keypress events aren't passed to my applet. This seems to be correlated to the use of xhost, but I haven't been able to figure out precisely why it occurs: Java was supposed to be portable.

I would have liked to display the compression trie used to store the tokens, but I didn't have enough time to implement it.

- Patrick Lam