org.amino.ds.graph
Class AdjacentNode<E>
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AdjacentNode
public AdjacentNode(Node<E> node,
double weight)
- Constructs an adjacent node, with specified node and weight.
- Parameters:
node
- the nodeweight
- weight of the node
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.