de.fraunhofer.ipsi.xquery.datamodel
Interface Sequence

All Superinterfaces:
java.lang.Cloneable, java.lang.Iterable<Item>
All Known Subinterfaces:
AtomicValue, AttributeNode, CommentNode, DocumentNode, ElementNode, Item, NamespaceNode, Node, ProcessingInstructionNode, TextNode

public interface Sequence
extends java.lang.Iterable<Item>, java.lang.Cloneable

This interface defines Sequences of the data model. The provided methods are analogous to methods in the java.util.List interface. The additional methods distinctDocOrder, deepEquals(Sequence seq) and booleanValue() are defined in the XQuery Specifications.

Author:
Patrick Lehti

Method Summary
 void add(Item item)
          Method add
 void addAll(Sequence seq)
          Method addAll
 boolean booleanValue()
          Method booleanValue
 java.lang.Object clone()
          Method clone
 boolean deepEquals(Sequence other)
          Method deepEquals
 Sequence distinctDocOrder()
          Method distinctDocOrder
 Item get(int pos)
          Method get
 int indexOf(Item item)
          Method index_of
 boolean isEmpty()
          Method isEmpty
 void setImmutable()
          Method setImmutable makes this sequence immutable.
 int size()
          Method size
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

add

void add(Item item)
Method add

Parameters:
item - an Item
Throws:
java.lang.UnsupportedOperationException - if this sequence is immutable
java.lang.NullPointerException - if item is null

addAll

void addAll(Sequence seq)
Method addAll

Parameters:
seq - a Sequence
Throws:
java.lang.UnsupportedOperationException - if this sequence is immutable

size

int size()
Method size

Returns:
an int

isEmpty

boolean isEmpty()
Method isEmpty

Returns:
a boolean

get

Item get(int pos)
Method get

Parameters:
pos - an int
Returns:
an Item
Throws:
java.lang.IndexOutOfBoundsException - if the given index is out of range (index < 0 || index >= size())

indexOf

int indexOf(Item item)
Method index_of

Parameters:
item - an Item
Returns:
an int

distinctDocOrder

Sequence distinctDocOrder()
Method distinctDocOrder

Returns:
a Sequence

deepEquals

boolean deepEquals(Sequence other)
Method deepEquals

Parameters:
other - a Sequence
Returns:
a boolean

booleanValue

boolean booleanValue()
Method booleanValue

Returns:
a boolean

setImmutable

void setImmutable()
Method setImmutable makes this sequence immutable. No further modifications are possible. I.e. calls of add(Item item) and addAll(Sequence seq) are not permitted.


clone

java.lang.Object clone()
Method clone

Returns:
an Object