Class: DeltaNode

DeltaNode(label, textnullable, type, baseNodenullable)

A node inside a CPEE process tree annotated with change related information. This class serves as the basis for diff visualization as well as merging.

Constructor

new DeltaNode(label, textnullable, type, baseNodenullable)

Construct a new DeltaNode instance.
Parameters:
Name Type Attributes Default Description
label String The label of the node.
text String <nullable>
null The text content of the node.
type String The type of change this node was affected by.
baseNode Number <nullable>
null The base node ID.
Implements:
Source:

Extends

Classes

DeltaNode

Members

(protected) _children :Array.<Node>

The ordered child list of this node.
Type:
Overrides:
Source:

(protected, nullable) _index :Number

The index of this node within the parent's ordered child list.
Type:
  • Number
Overrides:
Source:

(protected, nullable) _parent :Node

The parent of this node, if it exists.
Type:
Overrides:
Source:

(constant) attributes :Map.<String, String>

The attributes of this node.
Type:
  • Map.<String, String>
Overrides:
Source:

(nullable) baseNode :Number

The ID of the node in the base tree, if it exists, that this node corresponds to. Null indicates an inserted node
Type:
  • Number
Source:

children

Overrides:
Source:

index

Get the index of this node within the parent's ordered child list.
Overrides:
Source:

(constant) label :String

The label of this node.
Type:
  • String
Overrides:
Source:

parent

Get the parent of this node, if it exists.
Overrides:
Source:

(constant) placeholders :Array.<DeltaNode>

Placeholder children of this node that were deleted or moved away.
Type:
Source:

text :String

The text content of this node.
Type:
  • String
Overrides:
Source:

type :String

The type of change this node was affected by.
Type:
  • String
Source:

(constant) updates :Map.<String, Update>

The updates applied to the attributes and text content of this node.
Type:
Source:

Methods

(static) fromNode(node, includeChildren) → {DeltaNode}

Create a new DeltaNode instance from an existing node.
Parameters:
Name Type Description
node Node
includeChildren Boolean
Source:
Returns:
Type
DeltaNode

appendChild(node)

Parameters:
Name Type Description
node Node
Overrides:
Source:

changeIndex(index)

Move this node to a new position within the child list of its parent.
Parameters:
Name Type Description
index Number The new index.
Overrides:
Source:

contentEquals(other) → {Boolean}

Determines if the content of this node is equal to the content of another node.
Parameters:
Name Type Description
other Node
Overrides:
Source:
Returns:
True, iff the content equals.
Type
Boolean

degree() → {Number}

Overrides:
Source:
Returns:
The number of children of this node
Type
Number

findNode(indexPath) → {Node}

Fina a node in the sutree rooted at this node based on its index path.
Parameters:
Name Type Description
indexPath String The index path of the node.
Overrides:
Source:
Returns:
Type
Node

getChild(index) → {Node}

Parameters:
Name Type Description
index Number
Overrides:
Source:
Returns:
Type
Node

getLeftSibling() → (nullable) {Node}

Overrides:
Source:
Returns:
Type
Node

getRightSibling() → (nullable) {Node}

Overrides:
Source:
Returns:
Type
Node

getSiblings() → (nullable) {Array.<Node>}

Overrides:
Source:
Returns:
The child list of the parent node
Type
Array.<Node>

hasAttributes() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

hasChildren() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

hashEquals(other) → {Boolean}

Test for subtree hash equality with another subtree.
Parameters:
Name Type Description
other Node The root of the other subtree.
Overrides:
Source:
Returns:
True, iff their hashes equal.
Type
Boolean

hasInternalOrdering() → {Boolean}

NOTE: It is known that property nodes of inner nodes are still considered ordered by this function. This is fine for our purposes and unlikely to ever make a difference in reality.
Overrides:
Source:
Returns:
If the order of the children of this node has semantic implications in terms of the CPEE DSL.
Type
Boolean

hasText() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

inners() → {Array.<Node>}

Overrides:
Source:
Returns:
All inner nodes of this subtree in pre-order
Type
Array.<Node>

insertChild(index, node)

Insert a new child and adjust placeholder indices.
Parameters:
Name Type Description
index Number The position at which to insert the new child.
node Node The new child.
Overrides:
Source:

isAlternative() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isBreak() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isCall() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isCallArguments() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isCallLabel() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isCallMethod() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isChoice() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isCritical() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isDeleted() → {Boolean}

Source:
Returns:
If this node was deleted.
Type
Boolean

isEmpty() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isInnerNode() → {Boolean}

Overrides:
Source:
Returns:
If this node corresponds to a control flow DSL-Element in terms of the CPEE DSL {@see Dsl}.
Type
Boolean

isInnterruptLeafNode() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isInserted() → {Boolean}

Source:
Returns:
If this node was inserted.
Type
Boolean

isLeaf() → {Boolean}

Overrides:
Source:
Returns:
If this node corresponds to an activity DSL-Element in terms of the CPEE DSL {@see Dsl}.
Type
Boolean

isLoop() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isMoved() → {Boolean}

Source:
Returns:
If this node was moved.
Type
Boolean

isMovedFrom() → {Boolean}

Source:
Returns:
If this node is a placeholder for a moved node before it was moved.
Type
Boolean

isOtherwise() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isParallel() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isParallelBranch() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isPlaceholder() → {Boolean}

Source:
Returns:
If this node was deleted or moved away
Type
Boolean

isPropertyNode() → {Boolean}

Overrides:
Source:
Returns:
If this node corresponds to a property in terms of the CPEE DSL {@see Dsl}.
Type
Boolean

isRoot() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isScript() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isStop() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isTermination() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

isUnchanged() → {Boolean}

Source:
Returns:
If this node was not changed in any way regarding position or content.
Type
Boolean

isUpdated() → {Boolean}

Source:
Returns:
If this node was updated.
Type
Boolean

leaves() → {Array.<Node>}

Overrides:
Source:
Returns:
All leaf nodes of this subtree in pre-order
Type
Array.<Node>

nonPropertyNodes() → {Array.<Node>}

Overrides:
Source:
Returns:
All property nodes of this subtree in pre-order
Type
Array.<Node>

path(limitnullable) → {Array.<Node>}

Compute a subsequence of this node's path. The path is the sequence of all ancestors of this node, starting from the root (inclusive) to this node (inclusive).
Parameters:
Name Type Attributes Default Description
limit Number <nullable>
null The maximum length of the subsequence, unlimited if null.
Overrides:
Source:
Returns:
The subsequence of the path.
Type
Array.<Node>

removeFromParent()

Remove a node from the child list of its parent. Also adjust the indices of all placeholders. Note: The parent attribute is not cleared by this function.
Overrides:
Source:

size() → {number}

Warning: This function takes O(n) time!
Overrides:
Source:
Returns:
The size of the subtree rooted at this node.
Type
number

toPostOrderArray(arr) → {Array.<Node>}

Create a list of all nodes contained in the subtree rooted at this node in post-order.
Parameters:
Name Type Description
arr Array.<Node> Helper array for performance reasons.
Overrides:
Source:
Returns:
Type
Array.<Node>

toPreOrderArray(arr) → {Array.<Node>}

Create a list of all nodes contained in the subtree rooted at this node in pre-order.
Parameters:
Name Type Description
arr Array.<Node> Helper array for performance reasons.
Overrides:
Source:
Returns:
Type
Array.<Node>

toXmlDom(ownerDocument) → {Object}

Parameters:
Name Type Description
ownerDocument Object The owner document of the generated XML element.
Overrides:
Source:
Returns:
XML DOM object for this delta node and its children.
Type
Object

toXmlString() → {String}

Overrides:
Source:
Returns:
XML document of this node and its children.
Type
String

xPath() → {String}

Returns the an XPath like positional identifier for this node.
Overrides:
Source:
Returns:
The array of indices of all nodes on the path excluding the root.
Type
String