Public Member Functions
Collection Class Reference

A Collection is a persistent sequence of node items. More...

List of all members.

Public Member Functions

 Collection (const Collection &aMgr)
 Collection (zorba::Collection *aMgr)
ItemSequence 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 (const ItemSequence &aNodes)
 This function deletes zero of more nodes from a collection.
void deleteNodesFirst (unsigned long aNumNodes)
 This function deletes the n first nodes from a collection.
void deleteNodesLast (unsigned long aNumNodes)
 This function deletes the n last nodes from a collection.
Item getName ()
 Get the name of the collection.
TypeIdentifier getType ()
 Retrieves the sequence type for this (static declared) collection.
long long indexOf (const Item &aNode)
 This function returns the index of the given node in the collection.
void insertNodesAfter (const Item &aTarget, const ItemSequence &aNodes)
 This function inserts copies of the given nodes into a collection at the position directly following the given target node.
void insertNodesBefore (const Item &aTarget, const ItemSequence &aNodes)
 This function inserts copies of the given nodes into a collection at the position directly preceding the given target node.
void insertNodesFirst (const ItemSequence &aNodes)
 This function inserts copies of the given nodes at the beginning of the collection.
void insertNodesLast (const ItemSequence &aNodes)
 This function inserts copies of the given nodes at the end of the collection.
bool isStatic ()
 The function checks if this collection has been statically declared.

Detailed Description

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.

The variable aNodes passed to any of the insert functions is evaluated as though it were an enclosed expression in an element constructor. The result of this step is a sequence of nodes to be inserted into the collection.

Definition at line 29 of file Collection.h.


Constructor & Destructor Documentation

Collection::Collection ( const Collection aMgr)
inline

Definition at line 35 of file Collection.h.

Collection::Collection ( zorba::Collection *  aMgr)
inline

Definition at line 36 of file Collection.h.


Member Function Documentation

ItemSequence Collection::contents ( )

This function returns the sequence of nodes of the collection.

Returns:
The sequence contained in the given collection.
void Collection::deleteNodeFirst ( )

This function deletes the first node from a collection.

Exceptions:
XDDY0011if the collection doesn't contain any node.
void Collection::deleteNodeLast ( )

This function deletes the last node from a collection.

Exceptions:
XDDY0011if the collection doesn't contain any node.
void Collection::deleteNodes ( const ItemSequence aNodes)

This function deletes zero of more nodes from a collection.

Parameters:
aNodesthe nodes in the collection that should be deleted.
Exceptions:
XDDY0011if 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.
void Collection::deleteNodesFirst ( unsigned long  aNumNodes)

This function deletes the n first nodes from a collection.

Exceptions:
XDDY0011if the collection doesn't contain any node.
void Collection::deleteNodesLast ( unsigned long  aNumNodes)

This function deletes the n last nodes from a collection.

Exceptions:
XDDY0011if the collection doesn't contain any node.
Item Collection::getName ( )

Get the name of the collection.

Returns:
The name of the collection.
TypeIdentifier Collection::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.
See also:
isStatic()
long long Collection::indexOf ( const Item aNode)

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

Parameters:
aNodeThe node to retrieve the index from.
Returns:
Returns the position of the given node in the collection.
Exceptions:
XDDY0011if node is not contained in any collection.
void Collection::insertNodesAfter ( const Item aTarget,
const ItemSequence aNodes 
)

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

Parameters:
aTargetthe node in the collection after which the sequence should be inserted.
aNodesThe sequences of nodes whose copies should be added to the collection.
Exceptions:
XDDY0011if any nodes in the sequence is not a member of a collection or not all nodes of the sequence belong to the same collection.
void Collection::insertNodesBefore ( const Item aTarget,
const ItemSequence aNodes 
)

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

Parameters:
aTargetthe node in the collection before which the sequence should be inserted.
aNodesThe sequences of nodes whose copies should be added to the collection.
Exceptions:
XDDY0011if any nodes in the sequence is not a member of a collection or not all nodes of the sequence belong to the same collection.
void Collection::insertNodesFirst ( const ItemSequence aNodes)

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

Parameters:
aNodesThe sequences of nodes whose copies should be added to the collection.
void Collection::insertNodesLast ( const ItemSequence aNodes)

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

Parameters:
aNodesThe sequences of nodes whose copies should be added to the collection.
bool Collection::isStatic ( )

The function checks if this collection has been statically declared.

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

The documentation for this class was generated from the following file:
blog comments powered by Disqus