java.lang.Object
org.jruby.dirgra.DirectedGraph<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallData()Collection<Edge<T>>edges()edgesOfType(Object type) findOrCreateVertexFor(T data) Find existing vertex and if it is not present create it.findVertexFor(T data) getEdges()voidremoveEdge(Edge<T> edge) voidremoveEdge(T source, T destination) voidremoveVertexFor(T data) intsize()toString()vertices()
-
Constructor Details
-
DirectedGraph
public DirectedGraph()
-
-
Method Details
-
growEdges
-
getEdges
-
addEdge
-
removeEdge
-
vertices
-
edges
-
edgesOfType
-
allData
-
getInorderData
- Returns:
- data in the order it was added to this graph.
-
addEdge
-
removeEdge
-
findVertexFor
-
findOrCreateVertexFor
Find existing vertex and if it is not present create it.- Parameters:
data- to find a vertex for- Returns:
- vertex for given data. If vertex is not present it creates vertex and returns it.
-
removeVertexFor
-
size
public int size()- Returns:
- the number of vertices in the graph.
-
toString
-