com.icl.saxon.expr
Class  SingletonExpression
java.lang.Object
  |
  +--com.icl.saxon.expr.Expression
        |
        +--com.icl.saxon.expr.NodeSetExpression
              |
              +--com.icl.saxon.expr.SingletonExpression
- Direct Known Subclasses: 
- ContextNodeExpression, ParentNodeExpression, RootExpression
- public abstract class SingletonExpression- extends NodeSetExpression
A node set expression that will always return zero or one nodes
| Field Summary | 
| protected static java.util.Vector | emptyVector
 | 
 
 
 
 
 
| Methods inherited from class com.icl.saxon.expr.Expression | 
| containsReferences, evaluateAsNumber, getDependencies, getStaticContext, isNumeric, isRelative, make, make, reduce, setStaticContext, simplify, usesCurrent | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
emptyVector
protected static java.util.Vector emptyVector
SingletonExpression
public SingletonExpression()
getNode
public abstract NodeInfo getNode(Context context)
                          throws org.xml.sax.SAXException
- Get the single node to which this expression refers
selectFirst
public NodeInfo selectFirst(Context context)
                     throws org.xml.sax.SAXException
- Return the first node selected by this Expression when evaluated in the current context- 
- Overrides:
- selectFirstin class- NodeSetExpression
 
- 
- Parameters:
- context- The context for the evaluation
- Returns:
- the NodeInfo of the first node in document order, or null if the node-set
 is empty.
 
enumerate
public NodeEnumeration enumerate(Context context)
                          throws org.xml.sax.SAXException
- Evaluate the expression in a given context to return a Node enumeration- 
- Overrides:
- enumeratein class- NodeSetExpression
 
- 
- Parameters:
- context- the evaluation context
 
evaluateAsNodeSet
public NodeSetValue evaluateAsNodeSet(Context context)
                               throws org.xml.sax.SAXException
- Evaluate an expression as a NodeSet.- 
- Overrides:
- evaluateAsNodeSetin class- NodeSetExpression
 
- 
- Parameters:
- context- The context in which the expression is to be evaluated
- Returns:
- the value of the expression, evaluated in the current context
 
evaluateAsString
public java.lang.String evaluateAsString(Context context)
                                  throws org.xml.sax.SAXException
- Evaluate as a string. Returns the string value of the node if it exists- 
- Overrides:
- evaluateAsStringin class- NodeSetExpression
 
- 
- Parameters:
- context- The context in which the expression is to be evaluated
- Returns:
- true if there are any nodes selected by the NodeSetExpression
 
evaluateAsBoolean
public boolean evaluateAsBoolean(Context context)
                          throws org.xml.sax.SAXException
- Evaluate as a boolean. Returns true if there are any nodes
 selected by the NodeSetExpression- 
- Overrides:
- evaluateAsBooleanin class- NodeSetExpression
 
- 
- Parameters:
- context- The context in which the expression is to be evaluated
- Returns:
- true if there are any nodes selected by the NodeSetExpression