ExtendedSet

ExtendedSet

The ExtendedSet extends the native Set implementation, adding some functionality.

Constructor

new ExtendedSet()

Source:

Extends

  • Set

Members

contains

Source:
Check if a set contains an elem.

remove

Source:
Remove an object from a set.

Methods

elems() → {Array}

Source:
Get the items in the set.
Returns:
Array of elements in the set.
Type
Array

getKey(elem) → {string}

Source:
Extract a key from an object for the set dictionary.
Parameters:
Name Type Description
elem elem A graphics object to get a key for.
Returns:
A string representing the elen.
Type
string

intersect(other)

Source:
Remove items from the set if they are not contained in otherSet.
Parameters:
Name Type Description
other Set A set with which an intersection should be created.

isEmpty() → {boolean}

Source:
Returns whether the set is empty.
Returns:
Whether or not the set is empty.
Type
boolean

toString() → {string}

Source:
Create a string representation of the set. Follows the syntax 'Set: {elem, elem, elem}'
Returns:
String representation of the set
Type
string

union(other) → {Set}

Source:
Creates a union between two sets.
Parameters:
Name Type Description
other Set A set with which a union should be created.
Returns:
The union of the two sets
Type
Set