- Type Parameters:
V
- the graph vertex type
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DirectedAcyclicGraph.TopoVertexBiMap
,DirectedAcyclicGraph.TopoVertexMap
- Enclosing class:
- DirectedAcyclicGraph<V,
E>
An interface for storing the topological ordering.
- Author:
- Peter Giles
-
Method Summary
Modifier and TypeMethodDescriptiongetTopologicalIndex
(V vertex) Get the topological index of the given vertex.Get the vertex at the given topological index.void
Add a vertex at the given topological index.void
Remove all vertices from the topological ordering.removeVertex
(V vertex) Remove the given vertex from the topological ordering.
-
Method Details
-
putVertex
Add a vertex at the given topological index.- Parameters:
index
- the topological indexvertex
- the vertex
-
getVertex
Get the vertex at the given topological index.- Parameters:
index
- the topological index- Returns:
- vertex the vertex
-
getTopologicalIndex
Get the topological index of the given vertex.- Parameters:
vertex
- the vertex- Returns:
- the index that the vertex is at, or null if the vertex isn't in the topological ordering
-
removeVertex
Remove the given vertex from the topological ordering.- Parameters:
vertex
- the vertex- Returns:
- the index that the vertex was at, or null if the vertex wasn't in the topological ordering
-
removeAllVertices
void removeAllVertices()Remove all vertices from the topological ordering.
-