clark.xpath
Class AxisObject

java.lang.Object
  |
  +--clark.xpath.GeneralNode
        |
        +--clark.xpath.AxisObject
All Implemented Interfaces:
java.io.Serializable

public class AxisObject
extends GeneralNode
implements java.io.Serializable

The AxisObject is used to represent the Step in the tree of the compiled xpath. The class extends General Node. Holds information about the axis name, node test amd predicates. Holds information also on the next step.

See Also:
Serialized Form

Constructor Summary
AxisObject()
           
AxisObject(short axisOp_, clark.xpath.NodeTest nodetest_, java.util.LinkedList pred_, clark.xpath.AxisObject next)
          The main constructor.
AxisObject(java.lang.String varName, clark.xpath.AxisObject next)
          Constructor used ONLY for Variable Axis nodes.
 
Method Summary
 boolean checkNodeListResult()
          Checks whether the instances of this class will produce a node-list with method eval()
 clark.xpath.AtomicObject eval(w3c.dom.Node context)
          Extesnsion of General Node.
 short getAxisOp()
          Returns the axis name.
static int getContextSize()
          Returns the context size.
 clark.xpath.NodeTest getNodeTest()
          Returns the node test.
 short getNodeType()
          Returns the type of the object.
static int getProximityPosition()
          Returns the proximity position.
 short getReturnType()
          Returns the expected return type after the evaluation
 void setAxisOp(short axisOp_)
          Sets the Axis Name.
 void setNextAxis(clark.xpath.AxisObject next_)
          Sets the next Step.
 void setNodeTest(clark.xpath.NodeTest nodeTest_)
          Sets the node test.
 void setPredicates(java.util.LinkedList predicates_)
          Sets the Predicates.
static void setUsesContext()
          Used for optimization in predicate evaluation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisObject

public AxisObject(short axisOp_,
                  clark.xpath.NodeTest nodetest_,
                  java.util.LinkedList pred_,
                  clark.xpath.AxisObject next)
The main constructor. Inits the main object fields.

Parameters:
axisOp_ - The index of the Axis Name in Defs.
nodetest_ - Holding information about node test.
pred_ - LinkedList from compiled predicates.

AxisObject

public AxisObject(java.lang.String varName,
                  clark.xpath.AxisObject next)
Constructor used ONLY for Variable Axis nodes.(Alex)


AxisObject

public AxisObject()
Method Detail

setNextAxis

public void setNextAxis(clark.xpath.AxisObject next_)
Sets the next Step.

Parameters:
next_ - Next Step.

setAxisOp

public void setAxisOp(short axisOp_)
Sets the Axis Name.

Parameters:
axisOp_ - Axis name - index in Defs..

setPredicates

public void setPredicates(java.util.LinkedList predicates_)
Sets the Predicates.


setNodeTest

public void setNodeTest(clark.xpath.NodeTest nodeTest_)
Sets the node test. Used in predicate evaluation.


getAxisOp

public short getAxisOp()
Returns the axis name.


getNodeType

public short getNodeType()
Returns the type of the object.

Specified by:
getNodeType in class GeneralNode

getNodeTest

public clark.xpath.NodeTest getNodeTest()
Returns the node test.


getContextSize

public static int getContextSize()
Returns the context size. Used in predicate evaluation.


getProximityPosition

public static int getProximityPosition()
Returns the proximity position. Used in predicate evaluation. The evalution of the predicate depends on the context node.


setUsesContext

public static void setUsesContext()
Used for optimization in predicate evaluation. The evalution of the predicate depends on the context node.


eval

public clark.xpath.AtomicObject eval(w3c.dom.Node context)
                              throws ParseException
Extesnsion of General Node. The method is used for evalution of the Axis Object with specific context node.

Specified by:
eval in class GeneralNode
Parameters:
context - the context node.
Returns:
The result from the evaluation.
ParseException

checkNodeListResult

public boolean checkNodeListResult()
Description copied from class: GeneralNode
Checks whether the instances of this class will produce a node-list with method eval()

Specified by:
checkNodeListResult in class GeneralNode

getReturnType

public short getReturnType()
Description copied from class: GeneralNode
Returns the expected return type after the evaluation

Specified by:
getReturnType in class GeneralNode