Class NetworkBuilder<N,​E>

  • Type Parameters:
    N - The most general node type this builder will support. This is normally Object unless it is constrained by using a method like nodeOrder(com.google.common.graph.ElementOrder<N1>), or the builder is constructed based on an existing Network using from(Network).
    E - The most general edge type this builder will support. This is normally Object unless it is constrained by using a method like edgeOrder, or the builder is constructed based on an existing Network using from(Network).

    @Beta
    public final class NetworkBuilder<N,​E>
    extends java.lang.Object
    A builder for constructing instances of MutableNetwork or ImmutableNetwork with user-defined properties.

    A Network built by this class has the following default properties:

    • does not allow parallel edges
    • does not allow self-loops
    • orders Network.nodes() and Network.edges() in the order in which the elements were added (insertion order)

    Networks built by this class also guarantee that each collection-returning accessor returns a (live) unmodifiable view; see the external documentation for details.

    Examples of use:

    Since:
    20.0
    Author:
    James Sexton, Joshua O'Madadhain