io::zorba::api::xqj::ZorbaXQCollection

A Collection is a persistent sequence of node items. Instances of this class can be used to modify or retrieve the contents of a collection.

Private Attributes

boolean

closed

Collection

collection

java.util.Collection< XQSequence >

sequences

Protected Functions

ZorbaXQCollection(Collection col)

Public Functions

void

close()

Closes the collection.

XQSequence

contents()

This function returns the sequence of nodes of the collection.

void

deleteNodeFirst()

This function deletes the first node from a collection.

void

deleteNodeLast()

This function deletes the last node from a collection.

void

deleteNodes(XQSequence aNodes)

This function deletes zero of more nodes from a collection.

void

deleteNodesFirst(long aNumNodes)

This function deletes the n first nodes from a collection.

void

deleteNodesLast(long aNumNodes)

This function deletes the n last nodes from a collection.

String

getName()

Get the name of the collection.

ZorbaXQItemType

getType()

Retrieves the sequence type for this (static declared) collection.

long

indexOf(XQItem aNode)

This function returns the index of the given node in the collection.

void

insertNodesAfter(XQItem aTarget, XQSequence aNodes)

This function inserts copies of the given nodes into a collection at the position directly following the given target node.

void

insertNodesBefore(XQItem aTarget, XQSequence aNodes)

This function inserts copies of the given nodes into a collection at the position directly preceding the given target node.

void

insertNodesFirst(XQSequence aNodes)

This function inserts copies of the given nodes at the beginning of the collection.

void

insertNodesLast(XQSequence aNodes)

This function inserts copies of the given nodes at the end of the collection.

boolean

isClosed()

Checks if the collection is closed.

boolean

isStatic()

The function checks if this collection has been statically declared.

Private Functions

void

isClosedXQException()

Private Attributes

closed

boolean closed

collection

Collection collection

sequences

java.util.Collection< XQSequence > sequences

Protected Functions

ZorbaXQCollection

 ZorbaXQCollection(Collection col)

Public Functions

close

void close()

Closes the collection.

Once the collection is closed, no method other than close or the isClosed method may be called on the collection object. Calling close on an ZorbaXQCollection object that is already closed has no effect.

Parameters

XQException - if there is an error during closing the collection.

contents

XQSequence contents()

This function returns the sequence of nodes of the collection.

Returns

The sequence contained in the given collection.

deleteNodeFirst

void deleteNodeFirst()

This function deletes the first node from a collection.

Parameters

XQException if the collection doesn't contain any node.

deleteNodeLast

void deleteNodeLast()

This function deletes the last node from a collection.

Parameters

XQException if the collection doesn't contain any node.

deleteNodes

void deleteNodes(XQSequence aNodes)

This function deletes zero of more nodes from a collection.

Parameters

aNodes the nodes in the collection that should be deleted.

Parameters

XQException if any nodes in the given sequence is not a member of a collection or not all nodes of the sequence belong to the same collection.

deleteNodesFirst

void deleteNodesFirst(long aNumNodes)

This function deletes the n first nodes from a collection.

Parameters

XQException if the collection doesn't contain any node.

deleteNodesLast

void deleteNodesLast(long aNumNodes)

This function deletes the n last nodes from a collection.

Parameters

XQException if the collection doesn't contain any node.

getName

String getName()

Get the name of the collection.

Returns

The name of the collection.

getType

ZorbaXQItemType getType()

Retrieves the sequence type for this (static declared) collection.

Returns

the sequence type for the said collection, or 0 if this collection is not statically declared.

Returns

isStatic()

indexOf

long indexOf(XQItem aNode)

This function returns the index of the given node in the collection.

Parameters

aNode The node to retrieve the index from.

Returns

Returns the position of the given node in the collection.

Parameters

XQException if node is not contained in any collection.

insertNodesAfter

void insertNodesAfter(XQItem aTarget, XQSequence aNodes)

This function inserts copies of the given nodes into a collection at the position directly following the given target node.

Parameters

aTarget the node in the collection after which the sequence should be inserted.
aNodes The sequences of nodes whose copies should be added to the collection.

Parameters

XQException if any nodes in the sequence is not a member of a collection or not all nodes of the sequence belong to the same collection.

insertNodesBefore

void insertNodesBefore(XQItem aTarget, XQSequence aNodes)

This function inserts copies of the given nodes into a collection at the position directly preceding the given target node.

Parameters

aTarget the node in the collection before which the sequence should be inserted.
aNodes The sequences of nodes whose copies should be added to the collection.

Parameters

XQException if any nodes in the sequence is not a member of a collection or not all nodes of the sequence belong to the same collection.

insertNodesFirst

void insertNodesFirst(XQSequence aNodes)

This function inserts copies of the given nodes at the beginning of the collection.

Parameters

aNodes The sequences of nodes whose copies should be added to the collection.

insertNodesLast

void insertNodesLast(XQSequence aNodes)

This function inserts copies of the given nodes at the end of the collection.

Parameters

aNodes The sequences of nodes whose copies should be added to the collection.

isClosed

boolean isClosed()

Checks if the collection is closed.

Returns

true if the collection is in a closed state, false otherwise

isStatic

boolean isStatic()

The function checks if this collection has been statically declared.

Returns

true if the collection is a static collection, false otherwise.

Private Functions

isClosedXQException

void isClosedXQException()