(octave.info)containers.Map


Next: Cell Arrays Prev: Structures Up: Data Containers
Enter node , (file) or (file)node

6.2 containers.Map
==================

 -- : M = containers.Map ()
 -- : M = containers.Map (KEYS, VALS)
 -- : M = containers.Map (KEYS, VALS, "UniformValues", IS_UNIFORM)
 -- : M = containers.Map ("KeyType", KT, "ValueType", VT)

     Create an object of the containers.Map class that stores a list of
     key/value pairs.

     KEYS is an array of _unique_ keys for the map.  The keys can be
     numeric scalars or strings.  The type for numeric keys may be one
     of "double", "single", "int32", "uint32", "int64", or "uint64".
     Other numeric or logical keys will be converted to "double".  A
     single string key may be entered as is.  Multiple string keys are
     entered as a cell array of strings.

     VALS is an array of values for the map with the _same_ number of
     elements as KEYS.

     When called with no input arguments a default map is created with
     strings as the key type and "any" as the value type.

     The "UniformValues" option specifies whether the values of the map
     must be strictly of the same type.  If IS_UNIFORM is true, any
     values which would be added to the map are first validated to
     ensure they are of the correct type.

     When called with "KeyType" and "ValueType" arguments, create an
     empty map with the specified types.  The inputs KT and VT are the
     types for the keys and values of the map respectively.  Allowed
     values for KT are "char", "double", "single", "int32", "uint32",
     "int64", "uint64".  Allowed values for VT are "any", "char",
     "double", "single", "int32", "uint32", "int64", "uint64",
     "logical".

     The return value M is an object of the containers.Map class.

     See also: Note: struct.


automatically generated by info2www version 1.2.2.9