de.fzi.XPath
Class Step

java.lang.Object
  |
  +--de.fzi.XPath.Step

public class Step
extends java.lang.Object

Class Step represents single location step.


Constructor Summary
Step(int theaxis, NodeTest thenodetest)
          Constructor.
 
Method Summary
 void addPredicate(Expr predicate)
          Adds predicate to this step.
 int getAxis()
          Returns axis code of this location step.
 NodeTest getNodeTest()
          Returns axis code of this location step.
 Expr getPredicate(int index)
          Returns predicate at given position.
 int getPredicatesCount()
          Returns count of predicates in this location step.
 java.lang.String toString()
          Returns string representation of this location step.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Step

public Step(int theaxis,
            NodeTest thenodetest)
Constructor. Initializes a step with empty list of predicates.
Parameters:
theaxis - integer axis code of this location step.
TODO: no axis = Axis.CHILD axis.
thenodetext - nodetest of this location step.
See Also:
Axis, NodeTest
Method Detail

getAxis

public int getAxis()
Returns axis code of this location step.
Returns:
Returns axis code of this location step.
See Also:
Axis

getNodeTest

public NodeTest getNodeTest()
Returns axis code of this location step.
Returns:
Returns axis code of this location step.
See Also:
Axis

addPredicate

public void addPredicate(Expr predicate)
Adds predicate to this step.
Parameters:
predicate - predicate to be added. Predicate itself is simply another expression.

getPredicate

public Expr getPredicate(int index)
Returns predicate at given position.
Parameters:
index - position of the predicate.
Returns:
Predicate at position index or null if no predicate at this position.
See Also:
getPredicatesCount()

getPredicatesCount

public int getPredicatesCount()
Returns count of predicates in this location step.
Returns:
Returns count of predicates of this location step. If no predicates, will return 0.

toString

public java.lang.String toString()
Returns string representation of this location step.
Overrides:
toString in class java.lang.Object
Returns:
Returns string representation of this location step in form
"axis::nodetest[predicate]...
where predicates may be omitted. Axis is always in full non-abbreviated form.