# Section 8.5:
Container Classes

This section of the required library contains definitions of those abstractions and classes which define forms of container for other entities. For ease of indexing these are divided into generally functional groups - Arrays, Bags, General, Lists, Maps, Queues, Sets, Stacks, Trees.

- 8.5.1 Arrays

  1. Abstract Classes

     1. $RO_ARR - this abstraction models a read-only array as the interface to other array kinds.
     2. $ARR - this abstraction models a general array which has indices of class CARD whose values are strictly less than the array size.

  2. Reference Classes

     1. ARRAY - this class implements one-dimensional arrays of elements of some type T.
     2. ARRAY2 - this class implements two-dimensional arrays of elements of some type T.
     3. ARRAY3 - this class implements three-dimensional arrays of elements of some type T.

- 8.5.2 Bags

  1. Abstract Classes

     1. $RO_BAG - this abstraction models a read-only object container in which there is no specific ordering.
     2. $VBAG - this abstraction models the mathematical concept of a bag. It is a value abstraction!
     3. $BAG - this abstraction models the mathematical notion of a bag which supports modification features.

  2. Reference Classes

     1. VBAG - this class is an implementation of the mathematical concept of a bag of elements of some type. It has value semantics.
     2. BAG - this class is an implementation of the mathematical concept of a bag of elements of some type. An object of this class is modifiable.

- 8.5.3 General

  1. Abstract Classes

     1. $CONTAINER - this abstraction models the concept of a container of any kind.
     2. $DISPENSER - this abstraction models containers which only permit the removal of one element at a time.
     3. $BUCKET - this abstraction models the concept of a bucket which may be or may contain data objects of some kind.
     4. $NEXT - this abstraction models the notion of a link to the 'next' element in some container.

  2. Immutable Classes

     1. TUP - these classes implement the notion of a tuple of one, two, three or four components. It is possible to implement tuples of greater component cardinality, but this is not required.

  3. Reference Classes

     1. BUCKET - this class implements bucket constructors and the addition of a linked element. An object of this class only has a key value.
     2. DATABUCKET - this class implements bucket constructors and the addition of a linked element to an object which has both key and a data component.
     3. DYNAMIC_BUCKET_TABLE - this class implements a hash table using dynamic buckets.
     4. DYNAMIC_DATABUCKET_TABLE - this class implements a hash table using dynamic data buckets, storing keys and data.

- 8.5.4 Lists

  1. Abstract Classes

     1. $LIST - this abstraction models an extensible array. Each element of a list may be indexed using a cardinal number less than the current size of the list.

  2. Reference Classes

     1. FLIST - this class implements an array based extensible list of elements which has mutable semantics.
     2. FGAP_LIST - this class implements an array based list which provides for insertion and removal from the middle of the list as well as the end
     3. LIST - this class implements the notion of an array based list with immutable semantics.
     4. LLIST - this class implements a list having the notion of a current position which can both be advanced and 'rewound' permitting insertion and removal at any point in the list.

- 8.5.5 Maps

  1. Abstract Classes

     1. $RO_MAP - this abstraction models a read-only one-to-one map from a domain of keys to a range of elements.
     2. $VMAP - this abstraction models an unordered container of maps from keys to elements which provides value semantics only. No entry may be modified.
     3. $MAP - this abstraction models a modifiable map, elements of which may be replaced by assignment.
     4. $RO_MULTIMAP -this abstraction models a read-only mapping from a key to a bag of elements. This model is a many-to-one mapping.
     5. $VMULTIMAP - this abstraction models an unordered container of tuples of key to bsg of elements such that all keys are unique. The map elements have value semantics since they cannot be replaced.
     6. $MULTIMAP - this abstraction models an unordered container of tuples of key to bsg of elements such that all keys are unique. Elements of the map may be replaced.

  2. Reference Classes

     1. FMAP - this class implements maps from the domain of keys to a range of elements. This does not provides immutable smemantics.
     2. VMAP - this class implements a one-to-one map with value semantics.
     3. MAP - this class implements a one-to-one map, the elements of which may be modified and replaced.
     4. FMULTIMAP - this class implements maps from the domain of keys to bags of elements. This does not provides immutable smemantics.
     5. VMULTIMAP - this class implements a one-to-many map with value semantics.
     6. MULTIMAP - this class implements a one-to-many map, the elements of which may be modified and replaced.

- 8.5.6 Queues

  1. Abstract Classes

     1. $QUEUE - this abstraction models the notion of a FIFO queue of elements.
     2. $PQ - this abstraction models the notion of a queue of elements which is emptied in some priority order - however that may be determined.

  2. Reference Classes

     1. QUEUE - this class implements a FIFO queue of elements of some type.
     2. PQUEUE - this class implements a priority queue of elements ordered by some ordering class argument.

- 8.5.7 Sets

  1. Abstract Classes

     1. $RO_SET - this abstraction models the notion of a non-modifiable mathematical set.
     2. $VSET - this abstraction is a complete mathematical abstraction with value semantics.
     3. $SET - this abstraction is a complete mathematical abstraction with reference semantics.

  2. Reference Classes

     1. FSET - this class implements fast 'set' which has reference semantics.
     2. FQSET - this class implements fast 'set' with reference semantics which supports query processing.
     3. VSET - this class implements a set with immutable semantics - all modifying operations return a new object.
     4. SET - this class implements a set which has reference semantics.

- 8.5.8 Stacks

  1. Abstract Classes

     1. $STACK - this abstraction modifies the classic LIFO stack.

  2. Reference Classes

     1. STACK - this class implements the classic LIFO stack.

- 8.5.9 Trees

  1. Abstract Classes

     1. $BT_NODE - this class models the concept of a balanced tree.

  2. Reference Classes

     1. B_TREE - these classes implement the notion of a balanced tree structure which may be used as an alternative to a map if appropriate.

| Language Index |  | Library Index

Comments or enquiries should be made to Keith Hopper . Page last modified: Friday, 10 March 2000. |