maxon.DataDictionaryInterface

Description

Class to store and find any data type under any type of key.

Inheritance diagram

Inheritance

Parent Class:

Child Class:

Methods Signature

Contains(key)

Tests if the given key is a key of the dictionary.

Erase(key)

Erases data stored under the given key.

Get(key[, defaultValue])

Gets the value for the given key in the dictionary.

GetCount()

Returns the number of entries in the dictionary.

InitIterator(end)

Helper functions for initialize an iterator.

IsEmpty()

Checks if the dictionary is empty.

IsPopulated()

Checks if the dictionary contains anything.

Reset()

Frees the entire dictionary.

Set(key, value)

Sets a value for the given key in the dictionary.

Methods Definition

DataDictionaryInterface.Contains(key)

Tests if the given key is a key of the dictionary.

Parameters

key (maxon.Data) – Key under which the data should be stored.

Returns

True if existent.

Return type

bool

DataDictionaryInterface.Erase(key)
Erases data stored under the given key.

Does not check if the dictionary does contain the key and can be called in two ways:
  1. Using a FId: dict.Erase(maxon.MAXCHINEINFO.COMPUTERNAME, “data”)

  2. Using a registered data: dict.Erase(maxon.Int32(5))

Parameters

key (maxon.Data) – Key under which the data is stored.

DataDictionaryInterface.Get(key, defaultValue=None)
Gets the value for the given key in the dictionary.

A value can be retrieved in two ways:
  1. Using a FId: dict.Get(maxon.MAXCHINEINFO.COMPUTERNAME)

  2. Using a registered data type: dict.Get<String>(Int32(5))

Parameters
  • key (maxon.Data) – Key under which the data is stored.

  • defaultValue (maxon.Data.) – Default value which should be returned if the key cannot be found.

Raises

KeyError – When the given key does not exist.

Returns

maxon.Data converted to the right type if found in the dictionary, otherwise the default value.

DataDictionaryInterface.GetCount()

Returns the number of entries in the dictionary.

Returns

Number of dictionary entries.

Return type

int

DataDictionaryInterface.InitIterator(end)

Helper functions for initialize an iterator.

DataDictionaryInterface.IsEmpty()

Checks if the dictionary is empty.

Returns

True if the dictionary does not contain any elements.

Return type

bool

DataDictionaryInterface.IsPopulated()

Checks if the dictionary contains anything.

Returns

True if the dictionary contains any elements.

Return type

bool

DataDictionaryInterface.Reset()

Frees the entire dictionary. After this call the DataDictionary is empty.

DataDictionaryInterface.Set(key, value)
Sets a value for the given key in the dictionary.

A value can be set in two ways:
  1. Using a FId: dict.Set(maxon.MAXCHINEINFO.COMPUTERNAME, “data”)

  2. Using an registered data type: dict.Set(maxon.Int32(5), “data”)

Parameters