Package org.apache.calcite.util.graph
Class AttributedDirectedGraph<V,E extends DefaultEdge>
java.lang.Object
org.apache.calcite.util.graph.DefaultDirectedGraph<V,E>
org.apache.calcite.util.graph.AttributedDirectedGraph<V,E>
- Type Parameters:
V
- Vertex typeE
- Edge type
- All Implemented Interfaces:
DirectedGraph<V,
E>
Directed graph where edges have attributes and allows multiple edges between
any two vertices provided that their attributes are different.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Factory for edges that have attributes.Nested classes/interfaces inherited from interface org.apache.calcite.util.graph.DirectedGraph
DirectedGraph.EdgeFactory<V,
E> -
Constructor Summary
ConstructorDescriptionAttributedDirectedGraph
(@UnknownInitialization AttributedDirectedGraph.AttributedEdgeFactory<V, E> edgeFactory) Creates an attributed graph. -
Method Summary
Modifier and TypeMethodDescription@Nullable E
Deprecated.@Nullable E
static <V,
E extends DefaultEdge>
AttributedDirectedGraph<V,E> create
(AttributedDirectedGraph.AttributedEdgeFactory<V, E> edgeFactory) @Nullable E
Returns the first edge between one vertex to another.Returns all edges between one vertex to another.boolean
removeEdge
(V source, V target) Removes all edges from a given vertex to another.Methods inherited from class org.apache.calcite.util.graph.DefaultDirectedGraph
addVertex, create, create, edgeSet, getInwardEdges, getOutwardEdges, getVertex, removeAllVertices, toString, toStringUnordered, vertexSet
-
Constructor Details
-
AttributedDirectedGraph
public AttributedDirectedGraph(@UnknownInitialization AttributedDirectedGraph.AttributedEdgeFactory<V, E> edgeFactory) Creates an attributed graph.
-
-
Method Details
-
create
public static <V,E extends DefaultEdge> AttributedDirectedGraph<V,E> create(AttributedDirectedGraph.AttributedEdgeFactory<V, E> edgeFactory) -
getEdge
Returns the first edge between one vertex to another.- Specified by:
getEdge
in interfaceDirectedGraph<V,
E extends DefaultEdge> - Overrides:
getEdge
in classDefaultDirectedGraph<V,
E extends DefaultEdge>
-
addEdge
Deprecated.Description copied from interface:DirectedGraph
Adds an edge to this graph.- Specified by:
addEdge
in interfaceDirectedGraph<V,
E extends DefaultEdge> - Overrides:
addEdge
in classDefaultDirectedGraph<V,
E extends DefaultEdge> - Parameters:
vertex
- Source vertextargetVertex
- Target vertex- Returns:
- New edge, if added, otherwise null
-
addEdge
-
getEdges
Returns all edges between one vertex to another. -
removeEdge
Removes all edges from a given vertex to another. Returns whether any were removed.- Specified by:
removeEdge
in interfaceDirectedGraph<V,
E extends DefaultEdge> - Overrides:
removeEdge
in classDefaultDirectedGraph<V,
E extends DefaultEdge>
-
addEdge(Object, Object, Object...)
.