Package net.sf.saxon.om
Interface AtomicSequence
- All Superinterfaces:
GroundedValue,Iterable<AtomicValue>,Sequence
- All Known Implementing Classes:
AnyURIValue,AtomicArray,AtomicValue,Base64BinaryValue,BigDecimalValue,BigIntegerValue,BooleanValue,CalendarValue,CompactStringValue,DateTimeValue,DateValue,DayTimeDurationValue,DecimalValue,DoubleValue,DurationValue,EmptyAtomicSequence,FloatValue,GDateValue,GDayValue,GMonthDayValue,GMonthValue,GYearMonthValue,GYearValue,HexBinaryValue,Int64Value,IntegerRange,IntegerValue,NotationValue,NumericValue,QNameValue,QualifiedNameValue,StringValue,TimeValue,YearMonthDurationValue
Interface representing a sequence of atomic values. This is often used to represent the
typed value of a node. In most cases the typed value of a node is a single atomic value,
so the class AtomicValue implements this interface.
An AtomicSequence is always represented as a GroundedValue: that is, the entire sequence
is in memory, making operations such as itemAt(int) and getLength() possible.
-
Method Summary
Modifier and TypeMethodDescriptionGet the canonical lexical representation as defined in XML Schema.intGet the length of the sequenceGet a string representation of the sequence.head()Get the first item in the sequenceitemAt(int n) Get the Nth item in the sequence, zero-basediterate()Make an iterator over the items in the sequenceMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, getStringValue, materialize, reduce, subsequence, toShortStringMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Method Details
-
head
AtomicValue head()Get the first item in the sequence- Specified by:
headin interfaceGroundedValue- Specified by:
headin interfaceSequence- Returns:
- the first item in the sequence, or null if the sequence is empty
-
iterate
AtomicIterator iterate()Make an iterator over the items in the sequence- Specified by:
iteratein interfaceGroundedValue- Specified by:
iteratein interfaceSequence- Returns:
- an iterator over the items in the sequence
-
itemAt
Get the Nth item in the sequence, zero-based- Specified by:
itemAtin interfaceGroundedValue- Parameters:
n- the index of the required item, with 0 representing the first item in the sequence- Returns:
- the Nth item in the sequence, or null if the index is out of range
-
getLength
int getLength()Get the length of the sequence- Specified by:
getLengthin interfaceGroundedValue- Returns:
- the number of items in the sequence
-
getUnicodeStringValue
UnicodeString getUnicodeStringValue()Get a string representation of the sequence. The is the space-separated concatenation of the result of casting each of the items in the sequence to xs:string- Specified by:
getUnicodeStringValuein interfaceGroundedValue- Returns:
- a whitespace-separated concatenation of the string values of the items making up the sequence, as a String.
-
getCanonicalLexicalRepresentation
UnicodeString getCanonicalLexicalRepresentation()Get the canonical lexical representation as defined in XML Schema. This is not always the same as the result of casting to a string according to the XPath rules.- Returns:
- the canonical lexical representation if defined in XML Schema; otherwise, the result of casting to string according to the XPath 2.0 rules
-