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

Method nodeToIncidentEdges

output/java_guava/1.4.19/Graphs.java:435–445  ·  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

433
434
435 private static <N, E> Map<N, Set<E>> nodeToIncidentEdges(final Network<N, E> graph) {
436 checkNotNull(graph, "graph");
437 return Maps.asMap(
438 graph.nodes(),
439 new Function<N, Set<E>>() {
440 @Override
441 public Set<E> apply(N node) {
442 return graph.incidentEdges(node);
443 }
444 });
445 }
446
447
448 private static <N> Map<N, Set<N>> nodeToAdjacentNodes(final Graph<N> graph) {

Callers 1

hashCodeMethod · 0.95

Calls 3

asMapMethod · 0.95
nodesMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected