Unicorn XML Toolkit
Version 1.00.00

Namespace Xslt
Class CSortedArray

class CSortedArray: public CInterface {
public:
    CSortedArray();
    virtual ~CSortedArray();
public:
    virtual void AddSortAttributes(
        const CSortAttributes &sortAttributes) = 0;
    virtual void Add(
        const XNode &pNode, const XSortKey &pKey) = 0;
    virtual void Sort() = 0;
    virtual int GetSize() = 0;
    virtual XNode GetAt(int nIndex) = 0;
    virtual XSortedArrayIndex CreateIndex() = 0;
    };

The abstract interface to sorted arrays of nodes.

The sort order is specified by the list of sort attributes attached to the array.

The array is not sorted automatically when new nodes are added. The member function Sort must be explicitly called to sort the array.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CSortAttributes, CSortKey, CSortedArrayIndex, Dom::INode
Constructor/Destructor Summary
CSortedArray ();
����������Constructs the sorted array.
~CSortedArray ();
����������Destroys the sorted array.

Function Summary
void AddSortAttributes (const CSortAttributes &sortAttributes);
����������Adds the set of sort attributes to the end of the list of sort attributes attached to this array.
void Add (const XNode &pNode, const XSortKey &pKey);
����������Adds the node to this array.
void Sort ();
����������Sorts this array.
int GetSize ();
����������Returns the number of nodes in this array.
XNode GetAt (int nIndex);
����������Returns the node at the given index in this array.
XSortedArrayIndex CreateIndex ();
����������Creates an index for this array.

Constructor/Destructor Detail

CSortedArray

CSortedArray();

Constructs the sorted array.

~CSortedArray

virtual ~CSortedArray();

Destroys the sorted array.

Function Detail

AddSortAttributes

virtual void AddSortAttributes(
    const CSortAttributes &sortAttributes) = 0;

Adds the set of sort attributes to the end of the list of sort attributes attached to this array.

Parameters:
sortAttributes - the set of sort attributes to add

Add

virtual void Add(
    const XNode &pNode, const XSortKey &pKey) = 0;

Adds the node to this array.

Parameters:
pNode - the node to add
pKey - the sort key of the node to add

Sort

virtual void Sort() = 0;

Sorts this array.

GetSize

virtual int GetSize() = 0;

Returns the number of nodes in this array.

Returns:
the number of nodes in this array

GetAt

virtual XNode GetAt(int nIndex) = 0;

Returns the node at the given index in this array.

Parameters:
nIndex - the index of the node (zero-based)
Returns:
the node at given index in this array

CreateIndex

virtual XSortedArrayIndex CreateIndex() = 0;

Creates an index for this array.

The index profides an interface for sequential enumeration of nodes in the sorted array. See description of the CSortedArrayIndex class for details.

Returns:
the newly created sorted array index

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.