Class RedBlackNode<T extends Comparable<? super T>>

java.lang.Object
com.thomas.trees.BTNode<T>
com.thomas.trees.RedBlackNode<T>
Type Parameters:
T - The type of the node

public class RedBlackNode<T extends Comparable<? super T>> extends BTNode<T>
A simple implementation of a Red-Black Tree Node
See Also:
  • Constructor Details

  • Method Details

    • setColour

      public void setColour(Colour colour)
      Set the colour of the node
      Parameters:
      colour - The new colour
      See Also:
    • getColour

      public Colour getColour()
      Gets the colour of the node
      Returns:
      The colour of the node
      See Also:
    • isRed

      public boolean isRed()
      Checks if the node is RED
      Returns:
      if the node is RED
      See Also:
    • isBlack

      public boolean isBlack()
      Checks if the node is BLACK
      Returns:
      if the node is BLACK
      See Also:
    • setParent

      public void setParent(RedBlackNode<T> parent)
      Set the colour of the node
      Parameters:
      parent - The new parent
    • getParent

      public RedBlackNode<T> getParent()
      Gets the parent of this node
      Returns:
      The parent
    • getLeft

      public RedBlackNode<T> getLeft()
    • getRight

      public RedBlackNode<T> getRight()