Constructor
new ModelNode(logEvents)
Parameters:
Name | Type | Description |
---|---|---|
logEvents |
Array.<LogEvent> | The array of LogEvents from which a ModelGraph should be constructed |
- Source:
Extends
Methods
addChild(node)
Adds a child to this node, preserving the invariants described at the top of this document. Specifically:
The last two invariants are preserved by calling removeChild or removeParent on any existing children or parents that violate the invariants.
A node x cannot be the child of a node y if they have the same host.
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode | The child node to add |
- Inherited From:
- Source:
addParent(node)
Adds a parent to this node, preserving the invariants described at the top of this document. Specifically:
The last two invariants are preserved by calling removeChild or removeParent on any existing children or parents that violate the invariants.
A node x cannot be the parent of a node y if they have the same host.
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode | The node to add as a parent to this |
- Inherited From:
- Source:
clearChildren()
- Inherited From:
- Source:
clearFamily()
- Inherited From:
- Source:
clearParents()
- Inherited From:
- Source:
getChildByHost(host) → {AbstractNode}
Parameters:
Name | Type | Description |
---|---|---|
host |
String | The target host |
- Inherited From:
- Source:
Returns:
- Type
- AbstractNode
getChildren() → {Array.<AbstractNode>}
Returns children of this node as an array
This function makes no guarantees about the ordering of nodes in the array returned. Also note that a new array is created to prevent modification of the underlying private data structure, so this function takes linear rather than constant time on the number of children.
- Inherited From:
- Source:
Returns:
- Type
- Array.<AbstractNode>
getConnections() → {Array.<AbstractNode>}
Returns the nodes this one is connected to as an array. In the context of this function, a node is said to be connected to this one if it's the previous node, the next node, a parent, or a child. Note that if prev or next is a head or tail or null, it will still be returned.
This function makes no guarantees about the ordering of nodes in the array returned. Also note that a new array is created to prevent modification of the underlying private data structure, so this function takes linear rather than constant time on the number of connections.
- Inherited From:
- Source:
Returns:
- Type
- Array.<AbstractNode>
getFamily() → {Array.<AbstractNode>}
Returns the family nodes of this node as an array.
This function makes no guarantees about the ordering of nodes in the array returned. Also note that a new array is created to prevent modification of the underlying private data structure, so this function takes linear rather than constant time on the number of family nodes.
- Overrides:
- Source:
Returns:
- Type
- Array.<AbstractNode>
getFirstLogEvent() → {LogEvent}
- Source:
Returns:
- Type
- LogEvent
getHost() → {String}
- Inherited From:
- Source:
Returns:
- Type
- String
getId() → {Number}
- Inherited From:
- Source:
Returns:
- Type
- Number
getLogEventCount() → {Number}
- Source:
Returns:
- Type
- Number
getLogEvents() → {Array.<LogEvent>}
Gets the log events associated with the node
This function makes no guarantees about the ordering of LogEvents in the array returned. Also note that a new array is created to prevent modification of the underlying private data structure, so this function takes linear rather than constant time on the number of LogEvents.
- Source:
Returns:
- Type
- Array.<LogEvent>
getNext() → {AbstractNode}
- Inherited From:
- Source:
Returns:
- Type
- AbstractNode
getParentByHost(host) → {AbstractNode}
Parameters:
Name | Type | Description |
---|---|---|
host |
String | The target host |
- Inherited From:
- Source:
Returns:
- Type
- AbstractNode
getParents() → {Array.<AbstractNode>}
Returns parents of this node as an array
This function makes no guarantees about the ordering of nodes in the array returned. Also note that a new array is created to prevent modification of the underlying private data structure, so this function takes linear rather than constant time on the number of parents.
- Inherited From:
- Source:
Returns:
- Type
- Array.<AbstractNode>
getPrev() → {AbstractNode}
- Inherited From:
- Source:
Returns:
- Type
- AbstractNode
hasChildren() → {Boolean}
- Inherited From:
- Source:
Returns:
- Type
- Boolean
hasFamily() → {Boolean}
- Inherited From:
- Source:
Returns:
- Type
- Boolean
hasParents() → {Boolean}
- Inherited From:
- Source:
Returns:
- Type
- Boolean
insertNext(node)
Inserts a node after this one, preserving the invariants described at the top of this document. The node to insert is first removed from its previous location (i.e by calling AbstractNode#remove). You cannot insert a node after a tail node.
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode | The node to insert |
- Inherited From:
- Source:
insertPrev(node)
Inserts a node before this one, preserving the invariants described at the top of this document. The node to insert is first removed from its previous location (i.e by calling AbstractNode#remove). You cannot insert a node before a head node.
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode | The node to insert |
- Inherited From:
- Source:
isDummy() → {Boolean}
- Inherited From:
- Source:
Returns:
- Type
- Boolean
isHead() → {Boolean}
- Inherited From:
- Source:
Returns:
- Type
- Boolean
isTail() → {Boolean}
- Inherited From:
- Source:
Returns:
- Type
- Boolean
remove()
Removes a node, preserving the invariants described at the top of this document. This method will also remove all connections to the node. Head and tail nodes cannot be removed. This function does nothing if it is called on a node that had already been removed.
Because this method essentially removes all links to and from the node, be careful when using this inside a loop. For example, consider the following code:
var node = this.getHead(host).getNext(); while (!curr.isTail()) { curr.remove(); curr = curr.getNext(); // sets curr to null! curr.getNext() == null after removal }
- Inherited From:
- Source:
removeChild(node)
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode |
- Inherited From:
- Source:
removeChildByHost(host)
Parameters:
Name | Type | Description |
---|---|---|
host |
String |
- Inherited From:
- Source:
removeFamily(node)
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode |
- Inherited From:
- Source:
removeParent(node)
Parameters:
Name | Type | Description |
---|---|---|
node |
AbstractNode |
- Inherited From:
- Source:
removeParentByHost(host)
Parameters:
Name | Type | Description |
---|---|---|
host |
String |
- Inherited From:
- Source: