org.amino.ds.graph
Class Node<E>

java.lang.Object
  extended by org.amino.ds.graph.Node<E>
Type Parameters:
E - type of element in node
All Implemented Interfaces:
java.lang.Comparable<Node<E>>

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

Node in the graph.

Author:
Zhi Gan

Constructor Summary
Node(E e)
          Constructs a graph node, with specified element e.
 
Method Summary
 int compareTo(Node<E> o)
          
 boolean equals(java.lang.Object n)
          
 E getValue()
           
 int hashCode()
          
 void setValue(E value)
          set the value of this node.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(E e)
Constructs a graph node, with specified element e.

Parameters:
e - element in node
Method Detail

getValue

public E getValue()
Returns:
the value of this node

setValue

public void setValue(E value)
set the value of this node.

Parameters:
value - the value to be set

compareTo

public int compareTo(Node<E> o)

Specified by:
compareTo in interface java.lang.Comparable<Node<E>>

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object n)

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2008. All Rights Reserved.