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
Nested Classes Modifier and Type Interface Description static interface
DirectedGraph.EdgeFactory<V,E>
Factory for edges.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description E
addEdge(V vertex, V targetVertex)
Adds an edge to this graph.boolean
addVertex(V vertex)
Adds a vertex to this graph.java.util.Set<E>
edgeSet()
E
getEdge(V source, V target)
java.util.List<E>
getInwardEdges(V vertex)
java.util.List<E>
getOutwardEdges(V source)
void
removeAllVertices(java.util.Collection<V> collection)
boolean
removeEdge(V vertex, V targetVertex)
java.util.Set<V>
vertexSet()
-
-
-
Method Detail
-
addVertex
boolean addVertex(V vertex)
Adds a vertex to this graph.- Parameters:
vertex
- Vertex- Returns:
- Whether vertex was added
-
addEdge
E addEdge(V vertex, V targetVertex)
Adds an edge to this graph.- Parameters:
vertex
- Source vertextargetVertex
- Target vertex- Returns:
- New edge, if added, otherwise null
- Throws:
java.lang.IllegalArgumentException
- if either vertex is not already in graph
-
vertexSet
java.util.Set<V> vertexSet()
-
removeAllVertices
void removeAllVertices(java.util.Collection<V> collection)
-
edgeSet
java.util.Set<E> edgeSet()
-
-