API Documentation for: 0.11.8
Show:

platypus.DataMap Class

Uses
Defined in: platypus.DataMap:1
Module: platypus

Available since 0.8.0

This class defines a generic iterable data object. It behaves similarly to Map but maintains a list of keys as an Array. It includes recycle methods to encourage reuse.

Constructor

platypus.DataMap

() platypus.DataMap

Defined in platypus.DataMap:1

Available since 0.8.0

Returns:

platypus.DataMap:

dataMap Returns the new DataMap object.

Methods

clear

()

Defined in clear:134

Clears out of keys (and values) from the DataMap.

DataMap.recycle

(
  • dataMap
)

Defined in DataMap.recycle:186

Returns DataMap back to the cache. Prefer the DataMap's recycle method since it recycles property objects as well.

Parameters:

DataMap.setUp

() platypus.DataMap

Defined in DataMap.setUp:180

Returns DataMap from cache or creates a new one if none are available.

Returns:

platypus.DataMap:

dataMap The instantiated DataMap.

delete

(
  • key
)
Any

Defined in delete:125

Deletes a key (and value) from the DataMap.

Parameters:

  • key String

    The key to delete from the DataMap.

Returns:

Any:

value The value of the key is returned.

get

(
  • key
)
Any

Defined in get:97

Returns the value of the provided key.

Parameters:

  • key String

    The key to lookup.

Returns:

Any:

value The value of the provded key.

has

(
  • key
)
Boolean

Defined in has:106

Determines whether the provided key is available on this DataMap.

Parameters:

  • key String

    The key to lookup.

Returns:

Boolean:

value Whether the key is listed in this DataMap.

recycle

()

Defined in recycle:192

Relinquishes DataMap properties and recycles it.

set

(
  • key
  • value
)
Any

Defined in set:115

Sets a value to a key in the DataMap.

Parameters:

  • key String

    The key to associate with the provided value.

  • value Any

    The value to be stored by the DataMap.

Returns:

Any:

value The value passed in is returned for chaining.

toJSON

() Object

Defined in toJSON:141

Available since 0.11.0

Returns a JSON object describing the component.

Returns:

Object:

Returns a JSON definition that can be used to recreate the component.

Properties

keys

Array

Defined in keys:88

Tracks keys on this object to make iteration faster.

Default: []