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

java.lang.Object
  extended by org.amino.ds.graph.AdjacentNode<E>
Type Parameters:
E - Type of elements contained in AdjacentNode

public class AdjacentNode<E>
extends java.lang.Object

Objects of this class is used to express nodes in an adjacent list.

Author:
Zhi Gan

Constructor Summary
AdjacentNode(Node<E> node, double weight)
          Constructs an adjacent node, with specified node and weight.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 Node<E> getNode()
           
 double getWeight()
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdjacentNode

public AdjacentNode(Node<E> node,
                    double weight)
Constructs an adjacent node, with specified node and weight.

Parameters:
node - the node
weight - weight of the node
Method Detail

getNode

public Node<E> getNode()
Returns:
the "node" of this adjacent node, adjacent to head node

getWeight

public double getWeight()
Returns:
weight of this adjacent node, namely, weight of the edge from head node to this node

equals

public boolean equals(java.lang.Object o)

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.