Package org.apache.calcite.util.graph
Interface DirectedGraph<V,E>
- Type Parameters:
V
- Vertex typeE
- Edge type
- All Known Implementing Classes:
AttributedDirectedGraph
,DefaultDirectedGraph
public interface DirectedGraph<V,E>
Directed graph.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Factory for edges. -
Method Summary
Modifier and TypeMethodDescription@Nullable E
Adds an edge to this graph.boolean
Adds a vertex to this graph.edgeSet()
@Nullable E
getInwardEdges
(V vertex) getOutwardEdges
(V source) void
removeAllVertices
(Collection<V> collection) Removes from this graph all vertices that are incollection
, and the edges into and out of those vertices.boolean
removeEdge
(V vertex, V targetVertex)
-
Method Details
-
addVertex
Adds a vertex to this graph.- Parameters:
vertex
- Vertex- Returns:
- Whether vertex was added
-
addEdge
Adds an edge to this graph.- Parameters:
vertex
- Source vertextargetVertex
- Target vertex- Returns:
- New edge, if added, otherwise null
- Throws:
IllegalArgumentException
- if either vertex is not already in graph
-
getEdge
-
removeEdge
-
vertexSet
-
removeAllVertices
Removes from this graph all vertices that are incollection
, and the edges into and out of those vertices. -
getOutwardEdges
-
getInwardEdges
-
edgeSet
-