Savarese Software Research

com.savarese.algorithms.graph
Class Edge<V,W>

java.lang.Object
  extended by com.savarese.algorithms.graph.Edge<V,W>

public class Edge<V,W>
extends java.lang.Object

An Edge represents a directed or undirected connection between two vertices with an associated weight. The vertices can be interpreted as source and destination in the case of a directed edge or simply as endpoints in the case of an undirected edge.

Author:
Daniel F. Savarese

Constructor Summary
Edge(V src, V dest, W weight)
          Creates an Edge between source and destination vertices, assigning a weight to the link.
 
Method Summary
 V getDestination()
          Returns the destination vertex.
 V getSource()
          Returns the source vertex.
 W getWeight()
          Returns the edge weight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Edge

public Edge(V src,
            V dest,
            W weight)
Creates an Edge between source and destination vertices, assigning a weight to the link.

Parameters:
src - The source vertex.
dest - The destination vertex.
weight - The weight associated with the edge.
Method Detail

getSource

public V getSource()
Returns the source vertex.

Returns:
The source vertex.

getDestination

public V getDestination()
Returns the destination vertex.

Returns:
The destination vertex.

getWeight

public W getWeight()
Returns the edge weight.

Returns:
The edge weight.

Savarese Software Research

Copyright © 2004-2005 Savarese Software Research and Daniel F. Savarese. All Rights Reserved.