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

Method edgeToIncidentNodesString

output/java_guava/1.4.17/Graphs.java:467–482  ·  view source on GitHub ↗

Returns a function that transforms an edge into a string representation of its incident nodes in graph. The function's apply method will throw an IllegalArgumentException if graph does not contain edge.

(final Network<?, ?> graph)

Source from the content-addressed store, hash-verified

465
466
467 private static Function<Object, String> edgeToIncidentNodesString(final Network<?, ?> graph) {
468 if (graph.isDirected()) {
469 return new Function<Object, String>() {
470 @Override
471 public String apply(Object edge) {
472 return String.format("<%s -> %s>", graph.source(edge), graph.target(edge));
473 }
474 };
475 }
476 return new Function<Object, String>() {
477 @Override
478 public String apply(Object edge) {
479 return graph.incidentNodes(edge).toString();
480 }
481 };
482 }
483
484 /**
485 * Returns a string representation of the properties of {@code graph}.

Callers 1

toStringMethod · 0.95

Calls 1

isDirectedMethod · 0.65

Tested by

no test coverage detected