com.japisoft.formula.node
Class AbstractNode

java.lang.Object
  extended bycom.japisoft.formula.node.AbstractNode
Direct Known Subclasses:
BinaryOperatorNode, FunctionNode, GroupNode, ListNode, RootNode, TernaryOperatorNode, UnaryOperatorNode, ValueNode, VariableNode

public abstract class AbstractNode
extends java.lang.Object

Common node. Such node is a result of the parsing process, so this is not theorically mutable. However, you can access to all children and update the structure by inheriting from this node and change the children Vector content.

More information at : http://www.japisoft.com

Version:
1.0
Author:
(c) 2002-2003 JAPISoft

Field Summary
protected  java.util.Vector children
           
protected  boolean highPrecisionMode
           
protected  java.lang.String op
           
protected  int roundingMode
           
 
Constructor Summary
AbstractNode()
           
AbstractNode(int defroundingMode)
           
 
Method Summary
 void addChildNode(AbstractNode node)
          Add a new child
 void dump()
           
abstract  java.lang.Object evaluate(NodeContext ctx)
           
 AbstractNode getChildAt(int index)
           
 int getChildCount()
           
 int getColumn()
           
 java.lang.String getContent()
           
 int getLine()
           
 int getPos()
          Deprecated. you must call the getColumn or getLine method
 boolean isLeaf()
           
 void setContent(java.lang.String content)
          Set the node content like a function name, a variable name...
 void setOp(java.lang.String op)
           
 void setPos(int pos)
          Deprecated. you must call the setColumn or setLine method Reset the current node location in the expression
 void setPos(int line, int column)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

highPrecisionMode

protected boolean highPrecisionMode

roundingMode

protected int roundingMode

children

protected java.util.Vector children

op

protected java.lang.String op
Constructor Detail

AbstractNode

public AbstractNode()

AbstractNode

public AbstractNode(int defroundingMode)
Method Detail

getColumn

public int getColumn()
Returns:
the current column location for this node

getLine

public int getLine()
Returns:
the current line location for this node

setPos

public void setPos(int pos)
Deprecated. you must call the setColumn or setLine method Reset the current node location in the expression


setPos

public void setPos(int line,
                   int column)

getPos

public int getPos()
Deprecated. you must call the getColumn or getLine method


setOp

public void setOp(java.lang.String op)

setContent

public void setContent(java.lang.String content)
Set the node content like a function name, a variable name...


getContent

public java.lang.String getContent()
Returns:
the node content like a function name, a variable name

addChildNode

public void addChildNode(AbstractNode node)
Add a new child


isLeaf

public boolean isLeaf()

getChildCount

public int getChildCount()

getChildAt

public AbstractNode getChildAt(int index)

dump

public void dump()

evaluate

public abstract java.lang.Object evaluate(NodeContext ctx)
                                   throws EvaluateException
Throws:
EvaluateException