Package org.jgrapht.graph.builder
Class DirectedWeightedGraphBuilderBase<V,E,G extends DirectedGraph<V,E> & WeightedGraph<V,E>,B extends DirectedWeightedGraphBuilderBase<V,E,G,B>>
- java.lang.Object
-
- org.jgrapht.graph.builder.AbstractGraphBuilder<V,E,G,B>
-
- org.jgrapht.graph.builder.DirectedGraphBuilderBase<V,E,G,B>
-
- org.jgrapht.graph.builder.DirectedWeightedGraphBuilderBase<V,E,G,B>
-
- Type Parameters:
V- the graph vertex typeE- the graph edge typeG- type of the resulting graphB- type of this builder
- Direct Known Subclasses:
DirectedWeightedGraphBuilder
public abstract class DirectedWeightedGraphBuilderBase<V,E,G extends DirectedGraph<V,E> & WeightedGraph<V,E>,B extends DirectedWeightedGraphBuilderBase<V,E,G,B>> extends DirectedGraphBuilderBase<V,E,G,B>
Base class forDirectedWeightedGraphBuilderfor extending.
-
-
Field Summary
-
Fields inherited from class org.jgrapht.graph.builder.AbstractGraphBuilder
graph
-
-
Constructor Summary
Constructors Constructor Description DirectedWeightedGraphBuilderBase(G baseGraph)Creates a builder based onbaseGraph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaddEdge(V source, V target, double weight)Adds an weighted edge to the graph being built.BaddEdge(V source, V target, E edge, double weight)Adds the specified weighted edge to the graph being built.-
Methods inherited from class org.jgrapht.graph.builder.DirectedGraphBuilderBase
buildUnmodifiable
-
Methods inherited from class org.jgrapht.graph.builder.AbstractGraphBuilder
addEdge, addEdge, addEdgeChain, addGraph, addVertex, addVertices, build, removeEdge, removeEdge, removeVertex, removeVertices, self
-
-
-
-
Constructor Detail
-
DirectedWeightedGraphBuilderBase
public DirectedWeightedGraphBuilderBase(G baseGraph)
Creates a builder based onbaseGraph.baseGraphmust be mutable.- Parameters:
baseGraph- the graph object to base building on
-
-
Method Detail
-
addEdge
public B addEdge(V source, V target, double weight)
Adds an weighted edge to the graph being built. The source and target vertices are added to the graph, if not already included.- Parameters:
source- source vertex of the edge.target- target vertex of the edge.weight- weight of the edge.- Returns:
- this builder object
- See Also:
Graphs.addEdgeWithVertices(Graph, Object, Object, double)
-
addEdge
public B addEdge(V source, V target, E edge, double weight)
Adds the specified weighted edge to the graph being built. The source and target vertices are added to the graph, if not already included.- Parameters:
source- source vertex of the edge.target- target vertex of the edge.edge- edge to be added to this graph.weight- weight of the edge.- Returns:
- this builder object
- See Also:
Graph.addEdge(Object, Object, Object),WeightedGraph.setEdgeWeight(Object, double)
-
-