KeyMapKeyMap - Store a set of key/value pairs

Description:
The KeyMap class is used to store a set of values with associated keys which identify the values. The keys are strings. These may be case sensitive or insensitive as selected by the KeyCaseKeyCase attribute, and trailing spaces are ignored. The value associated with a key can be integer (signed 4 and 2 byte, or unsigned 1 byte), floating point (single or double precision), void pointer, character string or AST ObjectObject pointer. Each value can be a scalar or a one-dimensional vector. A KeyMap is conceptually similar to a MappingMapping in that a KeyMap transforms an input into an output - the input is the key, and the output is the value associated with the key. However, this is only a conceptual similarity, and it should be noted that the KeyMap class inherits from the Object class rather than the Mapping class. The methods of the Mapping class cannot be used with a KeyMap.
Constructor Function:
astKeyMapastKeyMap
Inheritance
The KeyMap class inherits from the Object class.
Attributes
In addition to those attributes common to all Objects, every KeyMap also has the following attributes:

  • KeyCaseKeyCase: Sets the case in which keys are stored

  • KeyErrorKeyError: ReportReport an error if the requested key does not exist?

  • SizeGuessSizeGuess: The expected size of the KeyMap.

  • SortBySortBy: Determines how keys are sorted in a KeyMap.

  • MapLockedMapLocked: Prevent new entries being added to the KeyMap?
Functions
In addition to those functions applicable to all Objects, the following functions may also be applied to all KeyMaps:

  • astMapDefined: Does a KeyMap contain a defined value for a key?

  • astMapGet0$<$X$>$astMapGet0X: Get a named scalar entry from a KeyMap

  • astMapGet1$<$X$>$astMapGet1X: Get a named vector entry from a KeyMap

  • astMapGetElem$<$X$>$astMapGetElemX: Get an element of a named vector entry from a KeyMap

  • astMapHasKeyastMapHasKey: Does the KeyMap contain a named entry?

  • astMapKeyastMapKey: Return the key name at a given index in the KeyMap

  • astMapLenCastMapLenC: Get the length of a named character entry in a KeyMap

  • astMapLengthastMapLength: Get the length of a named entry in a KeyMap

  • astMapCopyastMapCopy: Copy entries from one KeyMap into another

  • astMapPut0$<$X$>$astMapPut0X: Add a new scalar entry to a KeyMap

  • astMapPut1$<$X$>$astMapPut1X: Add a new vector entry to a KeyMap

  • astMapPutElem$<$X$>$astMapPutElemX: Puts a value into a vector entry in a KeyMap

  • astMapPutUastMapPutU: Add a new entry to a KeyMap with an undefined value

  • astMapRemoveastMapRemove: Removed a named entry from a KeyMap

  • astMapRenameastMapRename: Rename an existing entry in a KeyMap

  • astMapSizeastMapSize: Get the number of entries in a KeyMap

  • astMapTypeastMapType: Return the data type of a named entry in a map