org.kahina.tralesld.data.fs
Class TraleSLDFSPacker

java.lang.Object
  extended by org.kahina.tralesld.data.fs.TraleSLDFSPacker

public class TraleSLDFSPacker
extends Object

A TraleSLDFSPacker can be used to reduce memory usage when storing many strings with many shared substrings. This is achieved by breaking strings down into smaller units and storing the full strings as objects that recursively share substructures (a packed forest). The heuristic used for splitting strings up is geared towards strings where frequently occuring substrings start with "(" and end with ")". Note that strings stored using a bracket packer will not be garbage-collected until the bracket packer itself is.


Constructor Summary
TraleSLDFSPacker()
           
 
Method Summary
 TraleSLDFS pack(String string)
          Returns a structure-shared representation of the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraleSLDFSPacker

public TraleSLDFSPacker()
Method Detail

pack

public TraleSLDFS pack(String string)
Returns a structure-shared representation of the given string.