net.sf.saxon.expr
Class RootExpression

java.lang.Object
  extended by net.sf.saxon.expr.Expression
      extended by net.sf.saxon.expr.SingleNodeExpression
          extended by net.sf.saxon.expr.RootExpression
All Implemented Interfaces:
Serializable, SourceLocator, Container, EvaluableItem, SequenceIterable, InstructionInfoProvider

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 "/".

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
 
Constructor Summary
RootExpression()
           
 
Method Summary
 int computeCardinality()
          Specify that the expression returns a singleton
 void display(int level, PrintStream out, Configuration config)
          Diagnostic print of expression structure
 boolean equals(Object other)
          Is this expression the same as another expression?
 int getIntrinsicDependencies()
          Determine which aspects of the context the expression depends on.
 ItemType getItemType(TypeHierarchy th)
          Determine the data type of the items returned by this expression
 NodeInfo getNode(XPathContext context)
          Return the first element selected by this Expression
 int hashCode()
          get HashCode for comparing two expressions
 
Methods inherited from class net.sf.saxon.expr.SingleNodeExpression
computeSpecialProperties, effectiveBooleanValue, evaluateItem, iterate, optimize, typeCheck
 
Methods inherited from class net.sf.saxon.expr.Expression
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, evaluateAsString, getCardinality, getColumnNumber, getContainingProcedure, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, iterateSubExpressions, markTailFunctionCalls, process, promote, replaceSubExpression, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, simplify, suppressValidation
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootExpression

public RootExpression()
Method Detail

equals

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

Overrides:
equals in class Object

computeCardinality

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

Overrides:
computeCardinality in class SingleNodeExpression

getItemType

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

Overrides:
getItemType in class SingleNodeExpression
Parameters:
th -
Returns:
Type.NODE

hashCode

public int hashCode()
get HashCode for comparing two expressions

Overrides:
hashCode in class Object

getNode

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

Specified by:
getNode in class SingleNodeExpression
Parameters:
context - The evaluation context
Returns:
the NodeInfo of the first selected element, or null if no element is selected
Throws:
XPathException

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

Overrides:
getIntrinsicDependencies in class SingleNodeExpression
Returns:
a set of bit-significant flags identifying the "intrinsic" dependencies. The flags are documented in class net.sf.saxon.value.StaticProperty

display

public void display(int level,
                    PrintStream out,
                    Configuration config)
Diagnostic print of expression structure

Specified by:
display in class Expression
Parameters:
level - indentation level for this expression
out - Output destination


Copyright (C) Michael H. Kay. All rights reserved.