org.jgrapht.graph
Class ClassBasedEdgeFactory<V,E>

java.lang.Object
  extended by org.jgrapht.graph.ClassBasedEdgeFactory<V,E>
All Implemented Interfaces:
java.io.Serializable, EdgeFactory<V,E>

public class ClassBasedEdgeFactory<V,E>
extends java.lang.Object
implements EdgeFactory<V,E>, java.io.Serializable

An EdgeFactory for producing edges by using a class as a factory.

Since:
Jul 14, 2003
Author:
Barak Naveh
See Also:
Serialized Form

Constructor Summary
ClassBasedEdgeFactory(java.lang.Class<? extends E> edgeClass)
           
 
Method Summary
 E createEdge(V source, V target)
          Creates a new edge whose endpoints are the specified source and target vertices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassBasedEdgeFactory

public ClassBasedEdgeFactory(java.lang.Class<? extends E> edgeClass)
Method Detail

createEdge

public E createEdge(V source,
                    V target)
Description copied from interface: EdgeFactory
Creates a new edge whose endpoints are the specified source and target vertices.

Specified by:
createEdge in interface EdgeFactory<V,E>
Parameters:
source - the source vertex.
target - the target vertex.
Returns:
a new edge whose endpoints are the specified source and target vertices.
See Also:
EdgeFactory.createEdge(Object, Object)