new NodeSet()
A "set" container for Nodes
.
Methods
- copy() → NodeSet
- containsNode(node) → Boolean
- addNode(node)
- removeNode(node)
- equalsSet(nodeSet) → Boolean
- unionSet(nodeSet)
- minusSet(nodeSet)
- intersectSet(nodeSet)
- forEachNodeInSet(callback)
- nodesInLineOrder() → Array.<Node>
Method Details
-
copy() → {module:ft/core/nodeset.NodeSet}
-
Return a copy of this set.
Returns:
-
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>