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

Method from

guava/src/com/google/common/graph/GraphBuilder.java:95–100  ·  view source on GitHub ↗

Returns a {@link GraphBuilder} initialized with all properties queryable from {@code graph}. <p>The "queryable" properties are those that are exposed through the {@link Graph} interface, such as {@link Graph#isDirected()}. Other properties, such as {@link #expectedNodeCount(int)}, are not set in th

(Graph<N> graph)

Source from the content-addressed store, hash-verified

93 * are not set in the new builder.
94 */
95 public static <N> GraphBuilder<N> from(Graph<N> graph) {
96 return new GraphBuilder<N>(graph.isDirected())
97 .allowsSelfLoops(graph.allowsSelfLoops())
98 .nodeOrder(graph.nodeOrder())
99 .incidentEdgeOrder(graph.incidentEdgeOrder());
100 }
101
102 /**
103 * Returns an {@link ImmutableGraph.Builder} with the properties of this {@link GraphBuilder}.

Callers 6

copyOfMethod · 0.95
transitiveClosureMethod · 0.95
inducedSubgraphMethod · 0.95
copyOfMethod · 0.95

Calls 4

incidentEdgeOrderMethod · 0.65
nodeOrderMethod · 0.65
allowsSelfLoopsMethod · 0.65
isDirectedMethod · 0.65

Tested by 2