Package net.sf.saxon.value
Class EmptySequence
- java.lang.Object
-
- net.sf.saxon.value.Value
-
- net.sf.saxon.value.EmptySequence
-
- All Implemented Interfaces:
java.io.Serializable
,Expression
,ValueRepresentation
public final class EmptySequence extends Value
An EmptySequence object represents a sequence containing no members.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY
-
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
-
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
display(int level, java.io.PrintStream out, Configuration config)
Diagnostic print of expression structureboolean
effectiveBooleanValue(XPathContext context)
Get the effective boolean value - always falseboolean
equals(java.lang.Object other)
Is this expression the same as another expression?int
getCardinality()
Determine the static cardinalityint
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().static EmptySequence
getInstance()
Get the implicit instance of this classItemType
getItemType(TypeHierarchy th)
Determine the item typeint
getLength()
Get the length of the sequenceint
getSpecialProperties()
Get the static properties of this expression (other than its type).int
hashCode()
Return a hash code to support the equals() functionSequenceIterator
iterate(XPathContext context)
Return an iteration over the sequence-
Methods inherited from class net.sf.saxon.value.Value
asItem, asIterator, asValue, checkPermittedContents, convert, convertJavaObjectToXPath, convertToJava, evaluateAsString, evaluateItem, getDependencies, getIterator, getParentExpression, getStringValue, getStringValueCS, itemAt, iterateSubExpressions, makeQNameValue, optimize, process, promote, reduce, simplify, stringToNumber, toString, typeCheck
-
-
-
-
Method Detail
-
getInstance
public static EmptySequence getInstance()
Get the implicit instance of this class
-
getImplementationMethod
public int getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is prefered.
-
iterate
public SequenceIterator iterate(XPathContext context)
Return an iteration over the sequence- Parameters:
context
- The context in which the expression is to be evaluated. Note that this context must contain a stackframe with sufficient slots to allow evaluation of any variables contained in the expression (including variables allocated internally by the optimizer)- Returns:
- a SequenceIterator that can be used to iterate over the result of the expression
-
getItemType
public ItemType getItemType(TypeHierarchy th)
Determine the item type- Specified by:
getItemType
in interfaceExpression
- Overrides:
getItemType
in classValue
- Parameters:
th
-- Returns:
- for the default implementation: AnyItemType (not known)
-
getCardinality
public int getCardinality()
Determine the static cardinality- Specified by:
getCardinality
in interfaceExpression
- Overrides:
getCardinality
in classValue
- Returns:
- one of the values
StaticProperty.ALLOWS_ONE
,StaticProperty.ALLOWS_ZERO_OR_MORE
,StaticProperty.ALLOWS_ZERO_OR_ONE
,StaticProperty.ALLOWS_ONE_OR_MORE
,StaticProperty.EMPTY
. This default implementation returns ZERO_OR_MORE (which effectively gives no information).
-
getSpecialProperties
public int getSpecialProperties()
Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.- Specified by:
getSpecialProperties
in interfaceExpression
- Overrides:
getSpecialProperties
in classValue
- Returns:
StaticProperty.NON_CREATIVE
-
getLength
public final int getLength()
Get the length of the sequence
-
equals
public boolean equals(java.lang.Object other)
Is this expression the same as another expression?
-
hashCode
public int hashCode()
Description copied from class:Value
Return a hash code to support the equals() function
-
effectiveBooleanValue
public boolean effectiveBooleanValue(XPathContext context)
Get the effective boolean value - always false- Specified by:
effectiveBooleanValue
in interfaceExpression
- Overrides:
effectiveBooleanValue
in classValue
- Parameters:
context
- The context in which the expression is to be evaluated- Returns:
- the effective boolean value
-
display
public void display(int level, java.io.PrintStream out, Configuration config)
Diagnostic print of expression structure- Specified by:
display
in interfaceExpression
- Overrides:
display
in classValue
- Parameters:
level
- indentation level for this expressionout
- Output destination
-
-