FileDocCategorySizeDatePackage
TernarySearchTree2.javaAPI DocExample3756Wed Dec 16 19:14:54 GMT 1998tuning.struct

TernarySearchTree2

public class TernarySearchTree2 extends Object

Fields Summary
TernarySearchTreeNode2
root
char[]
buff
Constructors Summary
public TernarySearchTree2()

        buff = new char[5000];
    
Methods Summary
public java.lang.Objectget(java.lang.String s)

        if(root == null)
        {
            return null;
        }
        else
        {
            s.getChars(0, s.length(), buff, 0);
            return root.search(buff, 0, s.length() - 1);
        }
    
public java.lang.Objectput(java.lang.String s, java.lang.Object obj)

        s.getChars(0, s.length(), buff, 0);
        if(root == null)
            root = TernarySearchTreeNode2.newNode(buff[0]);
        return root.insert(buff, 0, s.length() - 1, obj);
    
public voidrelease()

        if(root != null)
        {
            root.clean();
            root = null;
        }