org.apache.commons.jxpath.ri.compiler

Class Path

Known Direct Subclasses:
ExpressionPath, LocationPath

public abstract class Path
extends Expression

Version:
$Revision: 1.14 $ $Date: 2004/04/01 02:55:32 $
Author:
Dmitri Plotnikov

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression

Expression.PointerIterator, Expression.ValueIterator

Field Summary

Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression

NOT_A_NUMBER, ONE, ZERO

Constructor Summary

Path(Step[] steps)

Method Summary

protected boolean
areBasicPredicates(predicates[] )
boolean
computeContextDependent()
protected EvalContext
createContextForStep(EvalContext context, int axis, NodeTest nodeTest)
Different axes are serviced by different contexts.
protected EvalContext
evalSteps(EvalContext context)
Given a root context, walks a path therefrom and builds a context that contains all nodes matching the path.
protected Pointer
getSingleNodePointerForSteps(EvalContext context)
Given a root context, walks a path therefrom and finds the pointer to the first element matching the path.
Step[]
getSteps()
boolean
isSimplePath()
Recognized paths formatted as foo/bar[3]/baz[@name = 'biz'] .
protected boolean
isSimpleStep(Step step)
A Step is "simple" if it takes one of these forms: ".", "/foo", "@bar", "/foo[3]".

Methods inherited from class org.apache.commons.jxpath.ri.compiler.Expression

compute, computeContextDependent, computeValue, isContextDependent, iterate, iteratePointers

Constructor Details

Path

public Path(Step[] steps)

Method Details

areBasicPredicates

protected boolean areBasicPredicates(predicates[] )

computeContextDependent

public boolean computeContextDependent()
Overrides:
computeContextDependent in interface Expression

createContextForStep

protected EvalContext createContextForStep(EvalContext context,
                                           int axis,
                                           NodeTest nodeTest)
Different axes are serviced by different contexts. This method allocates the right context for the supplied step.

evalSteps

protected EvalContext evalSteps(EvalContext context)
Given a root context, walks a path therefrom and builds a context that contains all nodes matching the path.

getSingleNodePointerForSteps

protected Pointer getSingleNodePointerForSteps(EvalContext context)
Given a root context, walks a path therefrom and finds the pointer to the first element matching the path.

getSteps

public Step[] getSteps()

isSimplePath

public boolean isSimplePath()
Recognized paths formatted as foo/bar[3]/baz[@name = 'biz'] . The evaluation of such "simple" paths is optimized and streamlined.

isSimpleStep

protected boolean isSimpleStep(Step step)
A Step is "simple" if it takes one of these forms: ".", "/foo", "@bar", "/foo[3]". If there are predicates, they should be context independent for the step to still be considered simple.