net.sf.saxon.expr
public final class CastExpression extends UnaryExpression
Field Summary | |
---|---|
static IntHashMap | castingTable |
Constructor Summary | |
---|---|
CastExpression(Expression source, AtomicType target, boolean allowEmpty) |
Method Summary | |
---|---|
static void | addAllowedCasts(int source, int[] target) |
int | computeCardinality()
Get the static cardinality of the expression |
int | computeSpecialProperties()
Determine the special properties of this expression |
protected String | displayOperator(NamePool pool)
Give a string representation of the operator for use in diagnostics |
AtomicValue | doQNameCast(StaticContext env)
Handle a cast to QName or NOTATION. |
boolean | equals(Object other)
Is this expression the same as another expression? |
Item | evaluateItem(XPathContext context)
Evaluate the expression |
ItemType | getItemType(TypeHierarchy th)
Get the static type of the expression |
static boolean | isPossibleCast(int source, int target)
Determine whether casting from a source type to a target type is possible |
Expression | simplify(StaticContext env)
Simplify the expression |
Expression | typeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression |
Returns: NON_CREATIVE.
Returns: the operator, as a string
Parameters: th
Parameters: source a primitive type (one that has an entry in the casting table) target another primitive type
Returns: true if the entry in the casting table is either "Y" (casting always succeeds) or "M" (casting allowed but may fail for some values)
Returns: the simplified expression