FileDocCategorySizeDatePackage
SimpleNode.javaAPI DocGlassfish v2 API7243Fri May 04 22:31:50 BST 2007com.sun.el.parser

SimpleNode

public abstract class SimpleNode extends ELSupport implements Node
author
Jacob Hookom [jacob@hookom.net]
version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: tcfujii $

Fields Summary
protected Node
parent
protected Node[]
children
protected int
id
protected String
image
Constructors Summary
public SimpleNode(int i)

        id = i;
    
Methods Summary
public voidaccept(com.sun.el.parser.NodeVisitor visitor)

        visitor.visit(this);
        if (this.children != null && this.children.length > 0) {
            for (int i = 0; i < this.children.length; i++) {
                this.children[i].accept(visitor);
            }
        }
    
public voiddump(java.lang.String prefix)

        System.out.println(toString(prefix));
        if (children != null) {
            for (int i = 0; i < children.length; ++i) {
                SimpleNode n = (SimpleNode) children[i];
                if (n != null) {
                    n.dump(prefix + " ");
                }
            }
        }
    
public booleanequals(java.lang.Object node)

        if (! (node instanceof SimpleNode)) {
            return false;
        }
        SimpleNode n = (SimpleNode) node;
        if (this.id != n.id) {
            return false;
        }
        if (this.children == null && n.children == null) {
            if (this.image == null) {
                return n.image == null;
            }
            return this.image.equals(n.image);
        }
        if (this.children == null || n.children == null) {
            // One is null and the other is non-null
            return false;
        }
        if (this.children.length != n.children.length) {
            return false;
        }
        if (this.children.length == 0) {
            if (this.image == null) {
                return n.image == null;
            }
            return this.image.equals(n.image);
        }
        for (int i = 0; i < this.children.length; i++) {
            if (! this.children[i].equals(n.children[i])) {
                return false;
            }
        }
        return true;
    
public java.lang.StringgetImage()

        return image;
    
public javax.el.MethodInfogetMethodInfo(com.sun.el.lang.EvaluationContext ctx, java.lang.Class[] paramTypes)

        throw new UnsupportedOperationException();
    
public java.lang.ClassgetType(com.sun.el.lang.EvaluationContext ctx)

        throw new UnsupportedOperationException();
    
public java.lang.ObjectgetValue(com.sun.el.lang.EvaluationContext ctx)

        throw new UnsupportedOperationException();
    
public inthashCode()

        if (this.children == null || this.children.length == 0) {
            if (this.image != null) {
                return this.image.hashCode();
            }
            return this.id;
        }
        int h = 0;
        for (int i = this.children.length - 1; i >=0; i--) {
            h = h + h + h + this.children[i].hashCode();
        }
        h = h + h + h + id;
        return h;
    
public java.lang.Objectinvoke(com.sun.el.lang.EvaluationContext ctx, java.lang.Class[] paramTypes, java.lang.Object[] paramValues)

        throw new UnsupportedOperationException();
    
public booleanisReadOnly(com.sun.el.lang.EvaluationContext ctx)

        return true;
    
public voidjjtAddChild(com.sun.el.parser.Node n, int i)

        if (children == null) {
            children = new Node[i + 1];
        } else if (i >= children.length) {
            Node c[] = new Node[i + 1];
            System.arraycopy(children, 0, c, 0, children.length);
            children = c;
        }
        children[i] = n;
    
public voidjjtClose()

    
public com.sun.el.parser.NodejjtGetChild(int i)

        return children[i];
    
public intjjtGetNumChildren()

        return (children == null) ? 0 : children.length;
    
public com.sun.el.parser.NodejjtGetParent()

        return parent;
    
public voidjjtOpen()

    
public voidjjtSetParent(com.sun.el.parser.Node n)

        parent = n;
    
public voidsetImage(java.lang.String image)

        this.image = image;
    
public voidsetValue(com.sun.el.lang.EvaluationContext ctx, java.lang.Object value)

        throw new PropertyNotWritableException(MessageFactory.get("error.syntax.set"));
    
public java.lang.StringtoString(java.lang.String prefix)

        return prefix + toString();
    
public java.lang.StringtoString()

        if (this.image != null) {
            return ELParserTreeConstants.jjtNodeName[id] + "[" + this.image
                    + "]";
        }
        return ELParserTreeConstants.jjtNodeName[id];