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

Method copyOf

guava/src/com/google/common/graph/ImmutableGraph.java:56–62  ·  view source on GitHub ↗

Returns an immutable copy of {@code graph}.

(Graph<N> graph)

Source from the content-addressed store, hash-verified

54
55 /** Returns an immutable copy of {@code graph}. */
56 public static <N> ImmutableGraph<N> copyOf(Graph<N> graph) {
57 return (graph instanceof ImmutableGraph)
58 ? (ImmutableGraph<N>) graph
59 : new ImmutableGraph<N>(
60 new StandardValueGraph<N, Presence>(
61 GraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size()));
62 }
63
64 /**
65 * Simply returns its argument.

Callers 7

buildMethod · 0.95
createSingleRootGraphMethod · 0.95
validateGraphMethod · 0.95
immutableGraphMethod · 0.95

Calls 5

fromMethod · 0.95
getNodeConnectionsMethod · 0.95
sizeMethod · 0.65
edgesMethod · 0.65
checkNotNullMethod · 0.45