Map
A map associates elements from a domain type with elements of a range
type. Map is a template class, with parameters for the domain and
range types. It extends a one-one Op by allowing explicit definition
of the value associated with an object.
Implementations:
- Map_FastSearchList
Uses a red-black track to associate
(pointer) range elements with (pointer) domain elements.
- Map_PropList
Stores the range in an object's
property list. The domain must be an SObject; the range must
be a pointer type.
Member functions:
- define: Map . Domain . Range -> void
Associates the
range element with the domain element; the domain element must not be
defined.
- is_defined: Map . Domain -> bool
Returns whether or
not the domain element is defined.
- lookup: Map . Domain -> Range
Returns the range
element associated with the domain element, which must be defined.
- redefine: Map . Domain . Range -> void
Changes the
domain element's association to the range element; the domain element
e must be defined.
- size: Map -> int
Returns the number of associations in
the map.
- undefine: Map . Domain -> void
Removes the domain
element's association; it must be defined.
Secondary operations:
- undefine_all Map . Domains . bool=false -> void
Undefines all the elements listed in the container, deleting the
corresponding range elements if the flag is set true.