Class: NodeSet

ft/core/nodeset. NodeSet

new NodeSet()

A "set" container for Nodes.

Methods




Method Details

copy() → {module:ft/core/nodeset.NodeSet}

Return a copy of this set.

Returns:
Type
module:ft/core/nodeset.NodeSet

containsNode(node) → {Boolean}

Return true if node is contained in this set.

Parameters:
Name Type Description
node module:ft/core/node.Node
Returns:
Type
Boolean

addNode(node)

Add a new node to this set.

Parameters:
Name Type Description
node module:ft/core/node.Node

removeNode(node)

Remove an existing node from this set.

Parameters:
Name Type Description
node module:ft/core/node.Node

equalsSet(nodeSet) → {Boolean}

Return true if this set contains the same nodes as the provided set.

Parameters:
Name Type Description
nodeSet module:ft/core/nodeset.NodeSet
Returns:
Type
Boolean

unionSet(nodeSet)

Add all nodes from the provided set to this set.

Parameters:
Name Type Description
nodeSet module:ft/core/nodeset.NodeSet

minusSet(nodeSet)

Remove all nodes from the provided set from this set.

Parameters:
Name Type Description
nodeSet module:ft/core/nodeset.NodeSet

intersectSet(nodeSet)

Remove all nodes from this set that are not also included in the provided set.

Parameters:
Name Type Description
nodeSet module:ft/core/nodeset.NodeSet

forEachNodeInSet(callback)

Process each node in this set using the provided callback.

Parameters:
Name Type Description
callback forEachNodeInSetCallback

Callback to process each node in the set.

nodesInLineOrder() → {Array.<module:ft/core/node.Node>}

Return the nodes in this set sorted by line number.

Returns:
Type
Array.<module:ft/core/node.Node>