Class Node

java.lang.Object
kkchengaf.EnchantmentOrder.Node

public class Node extends Object
The Node Class that maintains the optimal combining structure, left, right: the items in anvil to be combined, value: object of NodeValue that stores the information of a tree node
  • Constructor Details

    • Node

      public Node(Node l, Node r, NodeValue v)
      Tree Node Constructor
      Parameters:
      l - , Node, left child
      r - , Node, right child
      v - , NodeValue, the data
  • Method Details

    • getLeft

      public Node getLeft()
      get the left child
      Returns:
      Node
    • getRight

      public Node getRight()
      get the right child
      Returns:
      Node
    • getValue

      public NodeValue getValue()
      get the data of this node
      Returns:
      NodeValue
    • setValue

      public void setValue(NodeValue value)
      set the data of this node
      Parameters:
      value - , NodeValue
    • isItem

      public boolean isItem()
      check whether this node's data is an item
      Returns:
      boolean
    • toString

      public String toString()
      to String, return "" if data is unset
      Overrides:
      toString in class Object
      Returns:
      String