com.xml_project.morganaxproc.xdm
Interface Sequence


public interface Sequence

Interface for all sequences that can be wrapped to an XDMSequence


Method Summary
 XdmItem first()
          Get the first (if any) item in the sequence.
 String getStringValue()
          Return the string value of the items in the sequence.
 boolean hasCommonType()
          Checks whether all items in this sequence have the same type (i.e. xs:integer or node()).
 boolean hasValues()
          Checks whether the sequence contains at least one value (as opposed to nodes).
 boolean isEmpty()
          Checks whether the sequence is empty.
 XdmItemIterator iterator()
          Returns an iterator over this sequence.
 Sequence subSequence(long first, Double length)
          Returns a subsequence of this sequence with the given parameters.
 

Method Detail

first

XdmItem first()
              throws RuntimeException
Get the first (if any) item in the sequence.

Returns:
the first item in the sequence.
Throws:
RuntimeException - thrown, if there is no first item (empty list).

isEmpty

boolean isEmpty()
Checks whether the sequence is empty.

Returns:
true, if the sequence is empty.

getStringValue

String getStringValue()
Return the string value of the items in the sequence.

Returns:
the string value.

hasValues

boolean hasValues()
Checks whether the sequence contains at least one value (as opposed to nodes).

Returns:
true, if there is at least one value.

subSequence

Sequence subSequence(long first,
                     Double length)
                     throws XPathException
Returns a subsequence of this sequence with the given parameters.

Parameters:
first - the first item to include.
length - the number of items to include.
Returns:
a subsequence from this sequence.
Throws:
XPathException - thrown, if an error occurred (i.e. no more memory)

iterator

XdmItemIterator iterator()
Returns an iterator over this sequence.

Returns:
an iterator over this sequence.

hasCommonType

boolean hasCommonType()
Checks whether all items in this sequence have the same type (i.e. xs:integer or node()). If in doubt, return false.

Returns:
true, if all items have the same type.