clark.xpath
Class GeneralNode

java.lang.Object
  |
  +--clark.xpath.GeneralNode
Direct Known Subclasses:
AtomicObject, AxisObject, BinaryObject, FunctionCallObject, MultipleVarObject, UnaryObject, VariableObject

public abstract class GeneralNode
extends java.lang.Object

This is the most general node in the tree representaion of the XPath. The XPath engine passes through two main stages. First from a XPath string expression a tree is constructed. The second is an evaluation of the tree. The reason for these two stages is that the tree is constructed only once, but the evaluation is performed many times. The GeneralNode object is part of the tree. It itself do not present in the tree, but only its successors. It supplies two very important methods (getNodeType() and eval()) which are overriden in all successors where they do specific functions. So when we have any successor of GeneralNode we do not need to know its type in order to evaluate it. We just call eval() method.


Constructor Summary
GeneralNode()
           
 
Method Summary
abstract  boolean checkNodeListResult()
          Checks whether the instances of this class will produce a node-list with method eval()
abstract  clark.xpath.AtomicObject eval(w3c.dom.Node context)
          Eveluates a node and its whole subtree and returns an AtomicObject.
abstract  short getNodeType()
          Returns the type of the node.
abstract  short getReturnType()
          Returns the expected return type after the evaluation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralNode

public GeneralNode()
Method Detail

getNodeType

public abstract short getNodeType()
Returns the type of the node. It is used only by its successor classes. Here it returns -1 = error.


eval

public abstract clark.xpath.AtomicObject eval(w3c.dom.Node context)
                                       throws ParseException
Eveluates a node and its whole subtree and returns an AtomicObject. It is used only by its successor classes. Here it throws an exception. If everything is OK, then this methood will never be called.

ParseException

checkNodeListResult

public abstract boolean checkNodeListResult()
Checks whether the instances of this class will produce a node-list with method eval()


getReturnType

public abstract short getReturnType()
Returns the expected return type after the evaluation