StructMap

StructMap

Map-like data structure

Constructor

new StructMap() → {StructMap}

Source:
Returns:
Type:
StructMap
  • StructMap struct

Members

(static) data :Struct

Key-value pairs

Source:
Type:
  • Struct

(static) size :Number

Amount of defined entries.

Source:
Type:
  • Number

Methods

(static) clear()

Remove all items from StructMap

Source:

(static) exists(key) → {Bool}

Return true if the specified key exists in StructMap

Source:
Parameters:
Name Type Description
key Any
Returns:
Type:
Bool

(static) find(value, funcopt) → {Any}

Returns the first key associated with value. If no such key exists then the function will return undefined.

Source:
Parameters:
Name Type Attributes Description
value Any
func Method <optional>

function of two arguments to compare Map item with value

Returns:
Type:
Any

key associated with value

(static) get(key) → {Any}

Returns value associated with the key. If no such key exists then the function will return undefined.

Source:
Parameters:
Name Type Description
key Any
Returns:
Type:
Any

(static) is_empty() → {Bool}

Return false if StructMap has any items, true if it does not.

Source:
Returns:
Type:
Bool

(static) items() → {IteratorDict}

Returns Iterator of key-value pairs

Source:
Returns:
Type:
IteratorDict

(static) keys() → {Iterator}

Returns Iterator of keys

Source:
Returns:
Type:
Iterator

(static) remove(key)

Remove key from the StructMap

Source:
Parameters:
Name Type Description
key Any

(static) set(key, value) → {Bool}

Sets new value associated with key.

Source:
Parameters:
Name Type Description
key Any

If key exists, previous value would be overwritten.

value Any

If undefined, key is removed.

Returns:
Type:
Bool