XCC/J 6.0-3

com.marklogic.xcc.types
Interface XdmSequence<I extends XdmItem>

All Superinterfaces:
XdmValue
All Known Subinterfaces:
ResultSequence

public interface XdmSequence<I extends XdmItem>
extends XdmValue

A XdmValue which is a sequence of Items.


Method Summary
 String asString()
          This method is equivalent to asString ("\n").
 String asString(String separator)
          Returns a String comprised of XdmValue.asString() value of each item in the sequence with the given separator string between each.
 String[] asStrings()
          Returns an array of Strings, each of which is the value returned by the XdmValue.asString() method for each item in the sequence.
 boolean isEmpty()
          Indicates whether this XdmSequence is empty.
 XdmItem itemAt(int index)
          Return the XdmItem at the given position from this XdmSequence.
 Iterator<I> iterator()
          A java.util.Iterator instance that iterates over the items in this XdmSequence.
 int size()
          Returns the size of this XdmSequence.
 XdmItem[] toArray()
          Construct an array of XdmItems from this XdmSequence.
 String toString()
          Return a textual description of this XdmSequence object, NOT the value of the items in the sequence.
 
Methods inherited from interface com.marklogic.xcc.types.XdmValue
getValueType
 

Method Detail

size

int size()
Returns the size of this XdmSequence.

Returns:
The number of Items (possibly zero) in this sequence.

isEmpty

boolean isEmpty()
Indicates whether this XdmSequence is empty.

Returns:
true if size() == 0.

toArray

XdmItem[] toArray()
Construct an array of XdmItems from this XdmSequence.

Returns:
An array of XdmItem, possibly zero-length.

itemAt

XdmItem itemAt(int index)
Return the XdmItem at the given position from this XdmSequence.

Parameters:
index - The index of the XdmItem (zero-based) to return.
Returns:
An XdmItem instance.
Throws:
IllegalArgumentException - If index is negative or is greater than or equal to size().

iterator

Iterator<I> iterator()
A java.util.Iterator instance that iterates over the items in this XdmSequence.

Returns:
An Iterator over the XdmItem instances in this XdmSequence.

asString

String asString(String separator)
Returns a String comprised of XdmValue.asString() value of each item in the sequence with the given separator string between each. If the sequence is empty (isEmpty() is true) then the empty string is returned.

Parameters:
separator - A separator string, such as "\n", to be inserted between the XdmValue.asString() value of each item in the sequence. A value of null is equivalent to the empty string which causes all items to be concatenated with no separator.
Returns:
A string representation of the sequence.

asString

String asString()
This method is equivalent to asString ("\n").

Specified by:
asString in interface XdmValue
Returns:
A string representation of the sequence with a newline separator.

asStrings

String[] asStrings()
Returns an array of Strings, each of which is the value returned by the XdmValue.asString() method for each item in the sequence.

Returns:
An array of Strings.

toString

String toString()
Return a textual description of this XdmSequence object, NOT the value of the items in the sequence. Use the asString() or asStrings() methods to obtain String representations of the item values.

Overrides:
toString in class Object
Returns:
A textual description of this object, appropriate for use in a debug or log message.
See Also:
asString(), asStrings()

XCC/J 6.0-3

Copyright © 2013 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com