Class mindmaps.NodeMap
Defined in: NodeMap.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new NodeMap object.
|
Method Attributes | Method Name and Description |
---|---|
add(node)
Adds a node to the map if it hasn't been added before.
|
|
each(callback,)
Iterator for nodes.
|
|
get(nodeId)
Return a node by its ID.
|
|
remove(node)
Removes a node from the map.
|
|
size()
Returns the number of nodes in the map.
|
|
values()
Returns all nodes in the map.
|
Class Detail
mindmaps.NodeMap()
Creates a new NodeMap object. Map implementation for nodes. The key is
automatically set to the node id.
Method Detail
{Boolean}
add(node)
Adds a node to the map if it hasn't been added before.
- Parameters:
- {mindmaps.Node} node
- Returns:
- {Boolean} true if added, false otherwise.
each(callback,)
Iterator for nodes.
- Parameters:
- {Function} callback,
- first argument should be the node.
{mindmaps.Node}
get(nodeId)
Return a node by its ID.
- Parameters:
- {String} nodeId
- Returns:
- {mindmaps.Node}
{Boolean}
remove(node)
Removes a node from the map.
- Parameters:
- {mindmaps.Node} node
- Returns:
- {Boolean} true if removed, false otherwise.
{Number}
size()
Returns the number of nodes in the map.
- Returns:
- {Number}
{Array}
values()
Returns all nodes in the map.
- Returns:
- {Array}