org.sonar.graph
Class DirectedGraph<V,E extends Edge<V>>

java.lang.Object
  extended by org.sonar.graph.DirectedGraph<V,E>
All Implemented Interfaces:
DirectedGraphAccessor<V,E>

public class DirectedGraph<V,E extends Edge<V>>
extends Object
implements DirectedGraphAccessor<V,E>


Constructor Summary
DirectedGraph()
           
DirectedGraph(EdgeFactory<V,E> edgeFactory)
           
 
Method Summary
 DirectedGraph<V,E> addEdge(E edge)
           
 DirectedGraph<V,E> addEdge(V from, V to)
           
 DirectedGraph<V,E> addEdge(V from, V to, int weight)
           
 void addVertex(V vertex)
           
 void addVertices(Collection<V> vertices)
           
static DirectedGraph<String,StringEdge> createStringDirectedGraph()
           
 E getEdge(V from, V to)
           
 List<E> getEdges(Collection<V> vertices)
           
 Collection<E> getIncomingEdges(V to)
           
 Collection<E> getOutgoingEdges(V from)
           
 Set<V> getVertices()
           
 boolean hasEdge(V from, V to)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectedGraph

public DirectedGraph()

DirectedGraph

public DirectedGraph(EdgeFactory<V,E> edgeFactory)
Method Detail

createStringDirectedGraph

public static DirectedGraph<String,StringEdge> createStringDirectedGraph()

addEdge

public DirectedGraph<V,E> addEdge(V from,
                                  V to)

addEdge

public DirectedGraph<V,E> addEdge(V from,
                                  V to,
                                  int weight)

addEdge

public DirectedGraph<V,E> addEdge(E edge)

getEdge

public E getEdge(V from,
                 V to)
Specified by:
getEdge in interface DirectedGraphAccessor<V,E extends Edge<V>>

hasEdge

public boolean hasEdge(V from,
                       V to)
Specified by:
hasEdge in interface DirectedGraphAccessor<V,E extends Edge<V>>

addVertex

public void addVertex(V vertex)

addVertices

public void addVertices(Collection<V> vertices)

getVertices

public Set<V> getVertices()
Specified by:
getVertices in interface DirectedGraphAccessor<V,E extends Edge<V>>

getEdges

public List<E> getEdges(Collection<V> vertices)

getOutgoingEdges

public Collection<E> getOutgoingEdges(V from)
Specified by:
getOutgoingEdges in interface DirectedGraphAccessor<V,E extends Edge<V>>

getIncomingEdges

public Collection<E> getIncomingEdges(V to)
Specified by:
getIncomingEdges in interface DirectedGraphAccessor<V,E extends Edge<V>>


Copyright © 2009-2012 SonarSource. All Rights Reserved.