Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
SortedIterators


NAME

SortedIterators - return objects of an iterator in sorted order

SYNOPSIS

CONST ascending = 0;  (* in ascending order *)
CONST descending = 1; (* in descending order *)
TYPE Order = Iterators.Mode; (* ascending, descending *)


PROCEDURE Create(VAR sortedIt: Iterators.Iterator; unsortedIt: Iterators.Iterator; key: Keys.Key; order: Order);

DESCRIPTION

SortedIterators sorts object streams accessible via iterators using SortedBags that is based upon AVLTrees.

Create returns an iterator that allows to get the objects of unsortedIt in sorted order as defined by key and order. Note that all objects returned by unsortedIt must be extensions of Services.Object that support key.

DIAGNOSTICS

SortedIterators does not generate any diagnostics but failed assertions will occur in case of invalid parameters to Create and by underlying modules if one of the objects does not support key. If not all objects are extensions of Services.Object type guard failures will occur.

SEE ALSO

AVLTrees
implementation of AVL trees
Iterators
access of object streams
Keys
total order relations
SortedBags
sorted object collections

Edited by: borchert, last change: 2000/04/01, revision: 1.1, converted to HTML: 2000/04/01

Oberon || Library || Module Index || Search Engine || Definition || Module