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>

- 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 for `DirectedWeightedGraphBuilder` for extending.

- - ### Field Summary

    - ### Fields inherited from class org.jgrapht.graph.builder.AbstractGraphBuilder

      `graph`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirectedWeightedGraphBuilderBase(G baseGraph)` Creates a builder based on `baseGraph`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `addEdge(V source, V target, double weight)` Adds an 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, addEdgeChain, addGraph, addVertex, addVertices, build, removeEdge, removeVertex, removeVertices, self`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DirectedWeightedGraphBuilderBase

          public DirectedWeightedGraphBuilderBase(G baseGraph)

      Creates a builder based on `baseGraph`. `baseGraph` must 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)`

Copyright © 2016. All rights reserved.