MCPcopy Create free account
hub / github.com/antlr/codebuff / nodeToIncidentEdges

Method nodeToIncidentEdges

corpus/java/training/guava/graph/Graphs.java:417–425  ·  view source on GitHub ↗

Returns a map that is a live view of graph, with nodes as keys and the set of incident edges as values.

(final Network<N, E> graph)

Source from the content-addressed store, hash-verified

415 * and the set of incident edges as values.
416 */
417 private static <N, E> Map<N, Set<E>> nodeToIncidentEdges(final Network<N, E> graph) {
418 checkNotNull(graph, "graph");
419 return Maps.asMap(graph.nodes(), new Function<N, Set<E>>() {
420 @Override
421 public Set<E> apply(N node) {
422 return graph.incidentEdges(node);
423 }
424 });
425 }
426
427 private static <N> Map<N, Set<N>> nodeToAdjacentNodes(final Graph<N> graph) {
428 checkNotNull(graph, "graph");

Callers 1

hashCodeMethod · 0.95

Calls 3

asMapMethod · 0.95
nodesMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected