net.sf.saxon.expr

Class UntypedAtomicConverter

Implemented Interfaces:
EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator

public final class UntypedAtomicConverter
extends UnaryExpression

An UntypedAtomicConverter is an expression that converts any untypedAtomic items in a sequence to a specified type

Field Summary

Fields inherited from class net.sf.saxon.expr.UnaryExpression

operand

Fields inherited from class net.sf.saxon.expr.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Constructor Summary

UntypedAtomicConverter(Expression sequence, AtomicType requiredItemType, boolean allConverted)
Constructor

Method Summary

boolean
areAllItemsConverted()
Determine whether all items are to be converted, or only the subset that are untypedAtomic
int
computeCardinality()
Compute the static cardinality of this expression
int
computeSpecialProperties()
Determine the special properties of this expression
Expression
copy()
Copy an expression.
protected String
displayOperator(Configuration config)
Item
evaluateItem(XPathContext context)
Evaluate as an Item.
void
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
ItemType
getItemType(TypeHierarchy th)
Determine the data type of the items returned by the expression
ItemType
getRequiredItemType()
Get the item type to which untyped atomic items must be converted
SequenceIterator
iterate(XPathContext context)
Iterate over the sequence of values
Expression
typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression

Methods inherited from class net.sf.saxon.expr.UnaryExpression

computeCardinality, computeSpecialProperties, displayExpressionName, displayOperator, equals, explain, getBaseExpression, getItemType, hashCode, iterateSubExpressions, optimize, promote, replaceSubExpression, simplify, toString, typeCheck

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Constructor Details

UntypedAtomicConverter

public UntypedAtomicConverter(Expression sequence,
                              AtomicType requiredItemType,
                              boolean allConverted)
Constructor
Parameters:
sequence - this must be a sequence of atomic values. This is not checked; a ClassCastException will occur if the precondition is not satisfied.
requiredItemType - the item type to which untypedAtomic items in the sequence should be converted, using the rules for "cast as".
allConverted - true if the result of this expression is a sequence in which all items belong to the required type

Method Details

areAllItemsConverted

public boolean areAllItemsConverted()
Determine whether all items are to be converted, or only the subset that are untypedAtomic
Returns:
true if all items are to be converted

computeCardinality

public int computeCardinality()
Compute the static cardinality of this expression
Overrides:
computeCardinality in interface UnaryExpression

computeSpecialProperties

public int computeSpecialProperties()
Determine the special properties of this expression
Overrides:
computeSpecialProperties in interface UnaryExpression

copy

public Expression copy()
Copy an expression. This makes a deep copy.
Overrides:
copy in interface Expression
Returns:
the copy of the original expression

displayOperator

protected String displayOperator(Configuration config)
Overrides:
displayOperator in interface UnaryExpression

evaluateItem

public Item evaluateItem(XPathContext context)
            throws XPathException
Evaluate as an Item. This should only be called if the UntypedAtomicConverter has cardinality zero-or-one
Specified by:
evaluateItem in interface EvaluableItem
Overrides:
evaluateItem in interface Expression

explain

public void explain(ExpressionPresenter out)
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
Overrides:
explain in interface UnaryExpression

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the items returned by the expression
Overrides:
getItemType in interface UnaryExpression
Parameters:
th - the type hierarchy cache

getRequiredItemType

public ItemType getRequiredItemType()
Get the item type to which untyped atomic items must be converted
Returns:
the required item type

iterate

public SequenceIterator iterate(XPathContext context)
            throws XPathException
Iterate over the sequence of values
Specified by:
iterate in interface SequenceIterable
Overrides:
iterate in interface Expression

typeCheck

public Expression typeCheck(ExpressionVisitor visitor,
                            ItemType contextItemType)
            throws XPathException
Type-check the expression
Overrides:
typeCheck in interface UnaryExpression