org.jzy3d.maths.graphs
Class DefaultGraph<V,E>

java.lang.Object
  extended by org.jzy3d.maths.graphs.DefaultGraph<V,E>
All Implemented Interfaces:
IGraph<V,E>

public class DefaultGraph<V,E>
extends Object
implements IGraph<V,E>


Field Summary
protected  List<E> edges
           
protected  Map<E,V> edgeStart
           
protected  Map<E,V> edgeStop
           
protected  List<V> vertices
           
 
Constructor Summary
DefaultGraph()
           
 
Method Summary
 void addEdge(E edge, V v1, V v2)
           
 void addVertex(V vertex)
           
 List<E> getEdges()
           
 V getEdgeStartVertex(E e)
           
 V getEdgeStopVertex(E e)
           
 V getRandomVertex()
           
 V getVertex(int i)
           
 List<V> getVertices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

protected List<V> vertices

edges

protected List<E> edges

edgeStart

protected Map<E,V> edgeStart

edgeStop

protected Map<E,V> edgeStop
Constructor Detail

DefaultGraph

public DefaultGraph()
Method Detail

addVertex

public void addVertex(V vertex)
Specified by:
addVertex in interface IGraph<V,E>

getVertex

public V getVertex(int i)
Specified by:
getVertex in interface IGraph<V,E>

getVertices

public List<V> getVertices()
Specified by:
getVertices in interface IGraph<V,E>

addEdge

public void addEdge(E edge,
                    V v1,
                    V v2)
Specified by:
addEdge in interface IGraph<V,E>

getEdges

public List<E> getEdges()
Specified by:
getEdges in interface IGraph<V,E>

getEdgeStartVertex

public V getEdgeStartVertex(E e)
Specified by:
getEdgeStartVertex in interface IGraph<V,E>

getEdgeStopVertex

public V getEdgeStopVertex(E e)
Specified by:
getEdgeStopVertex in interface IGraph<V,E>

getRandomVertex

public V getRandomVertex()
Specified by:
getRandomVertex in interface IGraph<V,E>