Package org.apache.calcite.util.graph
Class DefaultDirectedGraph<V,E extends DefaultEdge>
java.lang.Object
org.apache.calcite.util.graph.DefaultDirectedGraph<V,E>
- Type Parameters:
V- Vertex typeE- Edge type
- All Implemented Interfaces:
DirectedGraph<V,E>
- Direct Known Subclasses:
AttributedDirectedGraph
public class DefaultDirectedGraph<V,E extends DefaultEdge>
extends Object
implements DirectedGraph<V,E>
Default implementation of
DirectedGraph.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.util.graph.DirectedGraph
DirectedGraph.EdgeFactory<V,E> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDirectedGraph(@UnknownInitialization DirectedGraph.EdgeFactory<V, E> edgeFactory) Creates a graph. -
Method Summary
Modifier and TypeMethodDescription@Nullable EAdds an edge to this graph.booleanAdds a vertex to this graph.static <V> DefaultDirectedGraph<V,DefaultEdge> create()static <V,E extends DefaultEdge>
DefaultDirectedGraph<V,E> create(DirectedGraph.EdgeFactory<V, E> edgeFactory) edgeSet()@Nullable EgetInwardEdges(V target) getOutwardEdges(V source) voidremoveAllVertices(Collection<V> collection) Removes from this graph all vertices that are incollection, and the edges into and out of those vertices.booleanremoveEdge(V source, V target) toString()Deprecated.
-
Constructor Details
-
DefaultDirectedGraph
Creates a graph.
-
-
Method Details
-
create
-
create
public static <V,E extends DefaultEdge> DefaultDirectedGraph<V,E> create(DirectedGraph.EdgeFactory<V, E> edgeFactory) -
toStringUnordered
Deprecated. -
toString
-
addVertex
Description copied from interface:DirectedGraphAdds a vertex to this graph.- Specified by:
addVertexin interfaceDirectedGraph<V,E extends DefaultEdge> - Parameters:
vertex- Vertex- Returns:
- Whether vertex was added
-
getVertex
-
edgeSet
- Specified by:
edgeSetin interfaceDirectedGraph<V,E extends DefaultEdge>
-
addEdge
Description copied from interface:DirectedGraphAdds an edge to this graph.- Specified by:
addEdgein interfaceDirectedGraph<V,E extends DefaultEdge> - Parameters:
vertex- Source vertextargetVertex- Target vertex- Returns:
- New edge, if added, otherwise null
-
getEdge
- Specified by:
getEdgein interfaceDirectedGraph<V,E extends DefaultEdge>
-
removeEdge
- Specified by:
removeEdgein interfaceDirectedGraph<V,E extends DefaultEdge>
-
vertexSet
- Specified by:
vertexSetin interfaceDirectedGraph<V,E extends DefaultEdge>
-
removeAllVertices
Description copied from interface:DirectedGraphRemoves from this graph all vertices that are incollection, and the edges into and out of those vertices.- Specified by:
removeAllVerticesin interfaceDirectedGraph<V,E extends DefaultEdge>
-
getOutwardEdges
- Specified by:
getOutwardEdgesin interfaceDirectedGraph<V,E extends DefaultEdge>
-
getInwardEdges
- Specified by:
getInwardEdgesin interfaceDirectedGraph<V,E extends DefaultEdge>
-