iitb.con.ds
Class Node<K extends java.lang.Comparable<K>>

java.lang.Object
  extended by iitb.con.ds.Node<K>
All Implemented Interfaces:
java.lang.Comparable<Node<K>>

public class Node<K extends java.lang.Comparable<K>>
extends java.lang.Object
implements java.lang.Comparable<Node<K>>

Node is a key-value pair. It is a generic structure to hold different data type which implements the Comparable interface to facilitate the comparison of keys.


Field Summary
 K key
          Generic key data type
 int value
          value for the key
 
Constructor Summary
Node()
           
Node(K key, int value)
           
 
Method Summary
 int compareTo(Node<K> node)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

public K extends java.lang.Comparable<K> key
Generic key data type


value

public int value
value for the key

Constructor Detail

Node

public Node()

Node

public Node(K key,
            int value)
Method Detail

compareTo

public int compareTo(Node<K> node)
Specified by:
compareTo in interface java.lang.Comparable<Node<K extends java.lang.Comparable<K>>>