Package org.jruby.dirgra
Class DirectedGraph<T extends ExplicitVertexID>
- java.lang.Object
-
- org.jruby.dirgra.DirectedGraph<T>
-
public class DirectedGraph<T extends ExplicitVertexID> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DirectedGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Edge<T>
addEdge(Edge<T> newEdge)
void
addEdge(T source, T destination, java.lang.Object type)
java.util.Collection<T>
allData()
java.util.Collection<Edge<T>>
edges()
java.lang.Iterable<Edge<T>>
edgesOfType(java.lang.Object type)
Vertex<T>
findOrCreateVertexFor(T data)
Vertex<T>
findVertexFor(T data)
protected Edge<T>[]
getEdges()
java.util.Collection<T>
getInorderData()
protected Edge<T>[]
growEdges(Edge<T>[] array, int realLength)
void
removeEdge(Edge<T> edge)
void
removeEdge(T source, T destination)
void
removeVertexFor(T data)
int
size()
java.lang.String
toString()
java.util.Collection<Vertex<T>>
vertices()
-
-
-
Method Detail
-
allData
public java.util.Collection<T> allData()
-
getInorderData
public java.util.Collection<T> getInorderData()
- Returns:
- data in the order it was added to this graph.
-
findOrCreateVertexFor
public Vertex<T> findOrCreateVertexFor(T data)
- Returns:
- vertex for given data. If vertex is not present it creates vertex and returns it.
-
removeVertexFor
public void removeVertexFor(T data)
-
size
public int size()
- Returns:
- the number of vertices in the graph.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-