java.lang.Object
org.jruby.dirgra.DirectedGraph<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
allData()
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()
void
removeEdge
(Edge<T> edge) void
removeEdge
(T source, T destination) void
removeVertexFor
(T data) int
size()
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
-