net.sf.saxon.value

Class UntypedAtomicValue

public class UntypedAtomicValue extends StringValue

An Untyped Atomic value. This inherits from StringValue for implementation convenience, even though an untypedAtomic value is not a String in the data model type hierarchy.
Field Summary
DoubleValuedoubleValue
static UntypedAtomicValueZERO_LENGTH_UNTYPED
Constructor Summary
UntypedAtomicValue(CharSequence value)
Constructor
Method Summary
intcompareTo(Object other, Comparator collator, XPathContext context)
Compare an untypedAtomic value with another value, using a given collator to perform any string comparisons.
AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type
ItemTypegetItemType(TypeHierarchy th)
Return the type of the expression
booleanschemaEquals(Value obj)
Compare two values for equality.

Field Detail

doubleValue

DoubleValue doubleValue

ZERO_LENGTH_UNTYPED

public static final UntypedAtomicValue ZERO_LENGTH_UNTYPED

Constructor Detail

UntypedAtomicValue

public UntypedAtomicValue(CharSequence value)
Constructor

Parameters: value the String value. Null is taken as equivalent to "".

Method Detail

compareTo

public int compareTo(Object other, Comparator collator, XPathContext context)
Compare an untypedAtomic value with another value, using a given collator to perform any string comparisons. This works by converting the untypedAtomic value to the type of the other operand, which is the correct behavior for operators like "=" and "!=", but not for "eq" and "ne": in the latter case, the untypedAtomic value is converted to a string and this method is therefore not used.

Returns: -1 if the this value is less than the other, 0 if they are equal, +1 if this value is greater.

convertPrimitive

public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type

getItemType

public ItemType getItemType(TypeHierarchy th)
Return the type of the expression

Parameters: th

Returns: Type.UNTYPED_ATOMIC (always)

schemaEquals

public boolean schemaEquals(Value obj)
Compare two values for equality. This supports identity constraints in XML Schema, which allow list-valued elements and attributes to participate in key and uniqueness constraints. This method returns false if any error occurs during the comparison, or if any of the items in either sequence is a node rather than an atomic value. The default implementation of schemaEquals() is the same as equals(), but subclasses can override this.