com.ibm.tivoli.maximo.report.expr

Class Node

  • java.lang.Object
    • com.ibm.tivoli.maximo.report.expr.Node


  • public class Node
    extends java.lang.Object
    In a parsed expression, a "node" is simply piece of data in the parse tree. Nodes have parents, children, and siblings. The purpose of the Node is to build an Abstract Parse Tree for an expression, where the node holds information such as where in the "string" the node was created, and what are the children, parent, and siblings in relation to this node.
    • Field Detail

      • UserNodeStart

        public static java.util.concurrent.atomic.AtomicInteger UserNodeStart
      • children

        public java.util.List children
      • parent

        public Node parent
      • type

        public int type
      • start

        public int start
      • end

        public int end
      • value

        public java.lang.String value
      • userData

        public java.lang.Object userData
      • whitespace

        public java.lang.StringBuilder whitespace
    • Constructor Detail

      • Node

        public Node(int type)
      • Node

        public Node(int type,
                    java.lang.String value)
      • Node

        public Node(Node parent,
                    int type,
                    java.lang.String value)
    • Method Detail

      • addChild

        public void addChild(Node node)
        Adds a child to node... If the child has a parent, then the child will be re-parented to this node.
        Parameters:
        node -
      • removeChild

        public void removeChild(Node node)
        Removes a child from our children, if it exists. If it doesn't exist, then nothing happens.
        Parameters:
        node -
      • accept

        public Node.Visitor.Status accept(Node.Visitor vis)
                                   throws java.rmi.RemoteException,
                                          MXException
        Apply a visitor to this node and it's children
        Parameters:
        vis -
        Throws:
        java.rmi.RemoteException - , MXException to have it compatible with MXException types
        MXException
      • visitChildren

        public Node.Visitor.Status visitChildren(Node.Visitor vis,
                                                 Node parent)
                                          throws java.rmi.RemoteException,
                                                 MXException
        Applies the visitor to the children of the given Parent, but NOT the parent itself.
        Parameters:
        vis -
        parent -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • nextSibling

        public Node nextSibling()
        Find the sibling that is adjacent after us
        Returns:
      • prevSibling

        public Node prevSibling()
        Find the sibling that is adjacent before us
        Returns:
      • dump

        public void dump(java.io.PrintStream writer)
        Dump the node informatoin to a writer
        Parameters:
        writer -
      • dump

        public void dump(java.io.PrintWriter writer)
        Dump the node informatoin to a writer
        Parameters:
        writer -
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toFormattedString

        public java.lang.String toFormattedString()
      • toFormattedStringChildrenOnly

        public java.lang.String toFormattedStringChildrenOnly()
      • child

        public Node child(int i)
      • find

        public Collector find(Collector c)
                       throws java.rmi.RemoteException,
                              MXException
        Like accept by returns the collector for convenience
        Parameters:
        c -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • addChildren

        public void addChildren(java.util.List children2)
        Adds all the children to this node
        Parameters:
        children2 -
      • last

        public Node last()
        Return the last child node
        Returns: