Package micycle.trapmap.graph
Class Node
- java.lang.Object
-
- micycle.trapmap.graph.Node
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Node()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
getLeftChildNode()
Get the left child node of this NodeNode
getParentNode()
Get the last parent node assigned to this Node.List<Node>
getParentNodes()
This is an updated method which returns the ArrayList of parents Nodes.Node
getRightChildNode()
Get the right child node of this Nodevoid
setLeftChildNode(Node newLChild)
Sets the left child node.void
setParentNode(Node newParent)
Add a parent to the list for this Nodevoid
setRightChildNode(Node newRChild)
Sets the right child node.
-
-
-
Method Detail
-
getParentNode
public Node getParentNode()
Get the last parent node assigned to this Node. This method is outdated since Nodes may have multiple parents in the final implementation- Returns:
- The value last stored as a parent Node
-
getParentNodes
public List<Node> getParentNodes()
This is an updated method which returns the ArrayList of parents Nodes. It returns the original object, hence trusts the user not to modify this list- Returns:
- The ArrayList containing all parent nodes
-
setParentNode
public void setParentNode(Node newParent)
Add a parent to the list for this Node- Parameters:
newParent
- The new parent Node to add
-
getLeftChildNode
public Node getLeftChildNode()
Get the left child node of this Node- Returns:
- The left child node
-
setLeftChildNode
public void setLeftChildNode(Node newLChild)
Sets the left child node. (Also sets the parent node of the new child to this)- Parameters:
newLChild
- The new left child node
-
getRightChildNode
public Node getRightChildNode()
Get the right child node of this Node- Returns:
- The right child node
-
setRightChildNode
public void setRightChildNode(Node newRChild)
Sets the right child node. (Also sets the parent node of the new child to this)- Parameters:
newRChild
- The new right child node
-
-