Oberon || Library || Module Index || Search Engine || Definition || Module
CONST ascending = 0; (* in ascending order *) CONST descending = 1; (* in descending order *) TYPE Order = Iterators.Mode; (* ascending, descending *)
TYPE Array = POINTER TO ArrayRec; TYPE ArrayRec = RECORD (Services.ObjectRec) END;
PROCEDURE Create(VAR array: Array; key: Keys.Key); PROCEDURE GetKey(array: Array; VAR key: Keys.Key); PROCEDURE Set(array: Array; keyval: Keys.Value; object: Objects.Object); PROCEDURE Get(array: Array; keyval: Keys.Value; VAR object: Objects.Object) : BOOLEAN; PROCEDURE Remove(array: Array; keyval: Keys.Value); PROCEDURE Exists(array: Array; keyval: Keys.Value) : BOOLEAN; PROCEDURE Card(array: Array) : INTEGER; PROCEDURE GetKeys(array: Array; order: Order; from, to: Keys.Value; VAR it: Iterators.Iterator); PROCEDURE GetEntries(array: Array; order: Order; from, to: Keys.Value; VAR it: Iterators.Iterator);
Create creates an array with key as sorting key. GetKey returns the key previously passed to Create.
Set sets the object of the array associated with keyval to object. This causes previous associations of keyval, if any, to be lost. Note that object must not be NIL. Get retrieves the object of the array associated with keyval. FALSE is returned, if no such association exists. Remove removes the association of keyval within array, if any. Exists returns TRUE if array includes an object associated with keyval. Card returns the number of associations within array.
GetKeys returns an iterator that generates the keys of the array, beginning from from up to and including to in sorted order. NIL may be given to designate the lowest or highest key value, respectively. GetEntries works similarly but returns the corresponding objects.
Oberon || Library || Module Index || Search Engine || Definition || Module