Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 KB | None | 0 0
  1. package eg.edu.alexu.csd.filestructure.redblacktree;
  2.  
  3. public class Node<T extends Comparable<T>, V> implements INode<T, V>  {
  4.     private INode parent;
  5.     private INode left;
  6.     private INode right;
  7.     private T Key;
  8.     private V Value;
  9.     private boolean color;
  10.     @Override
  11.     public void setParent(INode<T, V> parent) {
  12.         this.parent=parent;
  13.     }
  14.  
  15.     @Override
  16.     public INode getParent() {
  17.         return this.parent;
  18.     }
  19.  
  20.     @Override
  21.     public void setLeftChild(INode<T, V> leftChild) {
  22.         this.left=leftChild;
  23.     }
  24.  
  25.     @Override
  26.     public INode getLeftChild() {
  27.         return this.left;
  28.     }
  29.  
  30.     @Override
  31.     public void setRightChild(INode<T, V> rightChild) {
  32.         this.right=rightChild;
  33.     }
  34.  
  35.     @Override
  36.     public INode getRightChild() {
  37.         return this.right;
  38.     }
  39.  
  40.     @Override
  41.     public T getKey() {
  42.         return Key;
  43.     }
  44.  
  45.     @Override
  46.     public void setKey(Comparable key) {
  47.  
  48.     }
  49.  
  50.     @Override
  51.     public V getValue() {
  52.         return Value;
  53.     }
  54.  
  55.     @Override
  56.     public void setValue(Object value) {
  57.         this.Value= (V) value;
  58.     }
  59.  
  60.     @Override
  61.     public boolean getColor() {
  62.         return this.color;
  63.     }
  64.  
  65.     @Override
  66.     public void setColor(boolean color) {
  67.         this.color=color;
  68.     }
  69.  
  70.     @Override
  71.     public boolean isNull() {
  72.         return Key==null;
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement