dsa

Data Structures & Algorithms - Spring 2018
Log | Files | Refs | README

ChainNode.java (621B)


      1 package lab12;
      2 class ChainNode<K, V> {
      3   private K key;
      4   private V value;
      5   private ChainNode<K, V> next;
      6 
      7   public ChainNode(K newKey, V newValue,
      8                    ChainNode<K, V> nextNode) {
      9     key = newKey;
     10     value = newValue;
     11     next = nextNode;
     12   }  // end constructor
     13 
     14   public V getValue() {
     15     return value;
     16   }  // end getValue
     17 
     18   public K getKey() {
     19     return key;
     20   }  // end getKey
     21 
     22  public ChainNode<K, V> getNext()
     23   {
     24     return next;
     25   }  // end getNext
     26 
     27  public void setNext(ChainNode<K, V> next)
     28   {
     29     this.next=next;
     30   }  // end setNext
     31 
     32 
     33 } // end ChainNode