MCPcopy
hub / github.com/google/guava / from

Method from

guava/src/com/google/common/graph/NetworkBuilder.java:102–108  ·  view source on GitHub ↗

Returns a {@link NetworkBuilder} initialized with all properties queryable from {@code network}. <p>The "queryable" properties are those that are exposed through the {@link Network} interface, such as {@link Network#isDirected()}. Other properties, such as {@link #expectedNodeCount(int)}, are not s

(Network<N, E> network)

Source from the content-addressed store, hash-verified

100 * #expectedNodeCount(int)}, are not set in the new builder.
101 */
102 public static <N, E> NetworkBuilder<N, E> from(Network<N, E> network) {
103 return new NetworkBuilder<N, E>(network.isDirected())
104 .allowsParallelEdges(network.allowsParallelEdges())
105 .allowsSelfLoops(network.allowsSelfLoops())
106 .nodeOrder(network.nodeOrder())
107 .edgeOrder(network.edgeOrder());
108 }
109
110 /**
111 * Returns an {@link ImmutableNetwork.Builder} with the properties of this {@link NetworkBuilder}.

Callers 5

ImmutableNetworkMethod · 0.95
inducedSubgraphMethod · 0.95
copyOfMethod · 0.95

Calls 5

edgeOrderMethod · 0.65
nodeOrderMethod · 0.65
allowsSelfLoopsMethod · 0.65
allowsParallelEdgesMethod · 0.65
isDirectedMethod · 0.65

Tested by 2