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

java.lang.Object
  extended by org.amino.ds.graph.Edge<E>
Type Parameters:
E - type element in node

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

Edge in the graph.

Author:
Zhi Gan

Constructor Summary
Edge(Node<E> start, Node<E> end)
          Constructor an edge with default edge 1.
Edge(Node<E> start, Node<E> end, double weight)
          Construct an edge with weight.
 
Method Summary
 Node<E> getEnd()
           
 Node<E> getStart()
           
 double getWeight()
           
 void setWeight(double weight)
          set weight of this edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Edge

public Edge(Node<E> start,
            Node<E> end)
Constructor an edge with default edge 1.

Parameters:
start - start node
end - end node

Edge

public Edge(Node<E> start,
            Node<E> end,
            double weight)
Construct an edge with weight.

Parameters:
start - start node
end - end node
weight - weight on edge
Method Detail

getStart

public Node<E> getStart()
Returns:
start node

getEnd

public Node<E> getEnd()
Returns:
end node

getWeight

public double getWeight()
Returns:
weight of this edge

setWeight

public void setWeight(double weight)
set weight of this edge.

Parameters:
weight - weight to be set


Copyright © 2008. All Rights Reserved.