FileDocCategorySizeDatePackage
JTreeASTModel.javaAPI DocGlassfish v2 API2529Wed Aug 30 15:34:16 BST 2006persistence.antlr.debug.misc

JTreeASTModel

public class JTreeASTModel extends Object implements TreeModel

Fields Summary
persistence.antlr.collections.AST
root
Constructors Summary
public JTreeASTModel(persistence.antlr.collections.AST t)


       
        if (t == null) {
            throw new IllegalArgumentException("root is null");
        }
        root = t;
    
Methods Summary
public voidaddTreeModelListener(javax.swing.event.TreeModelListener l)

    
public java.lang.ObjectgetChild(java.lang.Object parent, int index)

        if (parent == null) {
            return null;
        }
        AST p = (AST)parent;
        AST c = p.getFirstChild();
        if (c == null) {
            throw new ArrayIndexOutOfBoundsException("node has no children");
        }
        int i = 0;
        while (c != null && i < index) {
            c = c.getNextSibling();
            i++;
        }
        return c;
    
public intgetChildCount(java.lang.Object parent)

        if (parent == null) {
            throw new IllegalArgumentException("root is null");
        }
        AST p = (AST)parent;
        AST c = p.getFirstChild();
        int i = 0;
        while (c != null) {
            c = c.getNextSibling();
            i++;
        }
        return i;
    
public intgetIndexOfChild(java.lang.Object parent, java.lang.Object child)

        if (parent == null || child == null) {
            throw new IllegalArgumentException("root or child is null");
        }
        AST p = (AST)parent;
        AST c = p.getFirstChild();
        if (c == null) {
            throw new ArrayIndexOutOfBoundsException("node has no children");
        }
        int i = 0;
        while (c != null && c != child) {
            c = c.getNextSibling();
            i++;
        }
        if (c == child) {
            return i;
        }
        throw new java.util.NoSuchElementException("node is not a child");
    
public java.lang.ObjectgetRoot()

        return root;
    
public booleanisLeaf(java.lang.Object node)

        if (node == null) {
            throw new IllegalArgumentException("node is null");
        }
        AST t = (AST)node;
        return t.getFirstChild() == null;
    
public voidremoveTreeModelListener(javax.swing.event.TreeModelListener l)

    
public voidvalueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)

        System.out.println("heh, who is calling this mystery method?");