MCPcopy Index your code
hub / github.com/antlr/codebuff / from

Method from

corpus/java/training/guava/graph/GraphBuilder.java:79–83  ·  view source on GitHub ↗

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

(Graph<N> graph)

Source from the content-addressed store, hash-verified

77 * are not set in the new builder.
78 */
79 public static <N> GraphBuilder<N> from(Graph<N> graph) {
80 // TODO(b/28087289): add allowsParallelEdges() once we support them
81 return new GraphBuilder<N>(graph.isDirected())
82 .allowsSelfLoops(graph.allowsSelfLoops());
83 }
84
85 /**
86 * Specifies whether the graph will allow self-loops (edges that connect a node to itself).

Callers 2

ImmutableGraphMethod · 0.95
copyOfMethod · 0.95

Calls 2

allowsSelfLoopsMethod · 0.65
isDirectedMethod · 0.65

Tested by

no test coverage detected