net.sf.saxon.expr

Class RootExpression

public class RootExpression extends SingleNodeExpression

An expression whose value is always a set of nodes containing a single node, the document root. This corresponds to the XPath Expression "/", including the implicit "/" at the start of a path expression with a leading "/".
Method Summary
intcomputeCardinality()
Specify that the expression returns a singleton
voiddisplay(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure
booleanequals(Object other)
Is this expression the same as another expression?
intgetIntrinsicDependencies()
Determine which aspects of the context the expression depends on.
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the items returned by this expression
NodeInfogetNode(XPathContext context)
Return the first element selected by this Expression
inthashCode()
get HashCode for comparing two expressions
Expressionsimplify(StaticContext env)
Simplify an expression

Method Detail

computeCardinality

public final int computeCardinality()
Specify that the expression returns a singleton

display

public void display(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure

equals

public boolean equals(Object other)
Is this expression the same as another expression?

getIntrinsicDependencies

public int getIntrinsicDependencies()
Determine which aspects of the context the expression depends on. The result is a bitwise-or'ed value composed from constants such as StaticProperty.VARIABLES and StaticProperty.CURRENT_NODE

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the items returned by this expression

Parameters: th

Returns: Type.NODE

getNode

public NodeInfo getNode(XPathContext context)
Return the first element selected by this Expression

Parameters: context The evaluation context

Returns: the NodeInfo of the first selected element, or null if no element is selected

hashCode

public int hashCode()
get HashCode for comparing two expressions

simplify

public Expression simplify(StaticContext env)
Simplify an expression

Returns: the simplified expression