net.sf.saxon.expr

Class AtomicSequenceConverter

public final class AtomicSequenceConverter extends UnaryExpression implements MappingFunction

An AtomicSequenceConverter is an expression that performs a cast on each member of a supplied sequence
Constructor Summary
AtomicSequenceConverter(Expression sequence, AtomicType requiredItemType)
Constructor
Method Summary
intcomputeCardinality()
Determine the static cardinality of the expression
intcomputeSpecialProperties()
Determine the special properties of this expression
protected StringdisplayOperator(NamePool pool)
Give a string representation of the operator for use in diagnostics
booleanequals(Object other)
Is this expression the same as another expression?
ItemevaluateItem(XPathContext context)
Evaluate as an Item.
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the items returned by the expression, if possible
SequenceIteratoriterate(XPathContext context)
Iterate over the sequence of values
Objectmap(Item item, XPathContext context)
Implement the mapping function
Expressionsimplify(StaticContext env)
Simplify an expression
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression

Constructor Detail

AtomicSequenceConverter

public AtomicSequenceConverter(Expression sequence, AtomicType requiredItemType)
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 all items in the sequence should be converted, using the rules for "cast as".

Method Detail

computeCardinality

public int computeCardinality()
Determine the static cardinality of the expression

computeSpecialProperties

public int computeSpecialProperties()
Determine the special properties of this expression

Returns: NON_CREATIVE.

displayOperator

protected String displayOperator(NamePool pool)
Give a string representation of the operator for use in diagnostics

Returns: the operator, as a string

equals

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

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate as an Item. This should only be called if the AtomicSequenceConverter has cardinality zero-or-one

getItemType

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

Parameters: th

Returns: a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known in advance)

iterate

public SequenceIterator iterate(XPathContext context)
Iterate over the sequence of values

map

public Object map(Item item, XPathContext context)
Implement the mapping function

simplify

public Expression simplify(StaticContext env)
Simplify an expression

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression