congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ValueGraph.edges
Code IndexAdd Tabnine to your IDE (free)

How to use
edges
method
in
com.google.common.graph.ValueGraph

Best Java code snippets using com.google.common.graph.ValueGraph.edges (Showing top 20 results out of 315)

origin: google/guava

 private static <N, V> Map<EndpointPair<N>, V> edgeValueMap(final ValueGraph<N, V> graph) {
  Function<EndpointPair<N>, V> edgeToValueFn =
    new Function<EndpointPair<N>, V>() {
     @Override
     public V apply(EndpointPair<N> edge) {
      return graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null);
     }
    };
  return Maps.asMap(graph.edges(), edgeToValueFn);
 }
}
origin: google/guava

/**
 * Defer to {@link AbstractValueGraph#edges()} (based on {@link #successors(Object)}) for full
 * edges() implementation.
 */
@Override
protected long edgeCount() {
 return delegate().edges().size();
}
origin: google/j2objc

 private static <N, V> Map<EndpointPair<N>, V> edgeValueMap(final ValueGraph<N, V> graph) {
  Function<EndpointPair<N>, V> edgeToValueFn =
    new Function<EndpointPair<N>, V>() {
     @Override
     public V apply(EndpointPair<N> edge) {
      return graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null);
     }
    };
  return Maps.asMap(graph.edges(), edgeToValueFn);
 }
}
origin: google/j2objc

/**
 * Defer to {@link AbstractValueGraph#edges()} (based on {@link #successors(Object)}) for full
 * edges() implementation.
 */
@Override
protected long edgeCount() {
 return delegate().edges().size();
}
origin: google/guava

private ImmutableValueGraph(ValueGraph<N, V> graph) {
 super(ValueGraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size());
}
origin: wildfly/wildfly

/**
 * Defer to {@link AbstractValueGraph#edges()} (based on {@link #successors(Object)}) for full
 * edges() implementation.
 */
@Override
protected long edgeCount() {
 return delegate().edges().size();
}
origin: wildfly/wildfly

 private static <N, V> Map<EndpointPair<N>, V> edgeValueMap(final ValueGraph<N, V> graph) {
  Function<EndpointPair<N>, V> edgeToValueFn =
    new Function<EndpointPair<N>, V>() {
     @Override
     public V apply(EndpointPair<N> edge) {
      return graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null);
     }
    };
  return Maps.asMap(graph.edges(), edgeToValueFn);
 }
}
origin: google/j2objc

private ImmutableValueGraph(ValueGraph<N, V> graph) {
 super(ValueGraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size());
}
origin: wildfly/wildfly

private ImmutableValueGraph(ValueGraph<N, V> graph) {
 super(ValueGraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size());
}
origin: google/guava

/** Creates a mutable copy of {@code graph} with the same nodes, edges, and edge values. */
public static <N, V> MutableValueGraph<N, V> copyOf(ValueGraph<N, V> graph) {
 MutableValueGraph<N, V> copy =
   ValueGraphBuilder.from(graph).expectedNodeCount(graph.nodes().size()).build();
 for (N node : graph.nodes()) {
  copy.addNode(node);
 }
 for (EndpointPair<N> edge : graph.edges()) {
  copy.putEdgeValue(
    edge.nodeU(), edge.nodeV(), graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null));
 }
 return copy;
}
origin: google/j2objc

/** Creates a mutable copy of {@code network} with the same nodes and edges. */
public static <N, E> MutableNetwork<N, E> copyOf(Network<N, E> network) {
 MutableNetwork<N, E> copy =
   NetworkBuilder.from(network)
     .expectedNodeCount(network.nodes().size())
     .expectedEdgeCount(network.edges().size())
     .build();
 for (N node : network.nodes()) {
  copy.addNode(node);
 }
 for (E edge : network.edges()) {
  EndpointPair<N> endpointPair = network.incidentNodes(edge);
  copy.addEdge(endpointPair.nodeU(), endpointPair.nodeV(), edge);
 }
 return copy;
}
origin: wildfly/wildfly

/** Creates a mutable copy of {@code graph} with the same nodes, edges, and edge values. */
public static <N, V> MutableValueGraph<N, V> copyOf(ValueGraph<N, V> graph) {
 MutableValueGraph<N, V> copy =
   ValueGraphBuilder.from(graph).expectedNodeCount(graph.nodes().size()).build();
 for (N node : graph.nodes()) {
  copy.addNode(node);
 }
 for (EndpointPair<N> edge : graph.edges()) {
  copy.putEdgeValue(
    edge.nodeU(), edge.nodeV(), graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null));
 }
 return copy;
}
origin: com.io7m.jgrapht/jgrapht-guava

@Override
public boolean containsEdge(EndpointPair<V> e)
{
  return valueGraph.edges().contains(e);
}
origin: com.io7m.jgrapht/jgrapht-guava

@Override
public Set<EndpointPair<V>> edgeSet()
{
  if (unmodifiableEdgeSet == null) {
    unmodifiableEdgeSet = Collections.unmodifiableSet(valueGraph.edges());
  }
  return unmodifiableEdgeSet;
}
origin: org.jboss.eap/wildfly-client-all

 private static <N, V> Map<EndpointPair<N>, V> edgeValueMap(final ValueGraph<N, V> graph) {
  Function<EndpointPair<N>, V> edgeToValueFn =
    new Function<EndpointPair<N>, V>() {
     @Override
     public V apply(EndpointPair<N> edge) {
      return graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null);
     }
    };
  return Maps.asMap(graph.edges(), edgeToValueFn);
 }
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Defer to {@link AbstractValueGraph#edges()} (based on {@link #successors(Object)}) for full
 * edges() implementation.
 */
@Override
protected long edgeCount() {
 return delegate().edges().size();
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Defer to {@link AbstractValueGraph#edges()} (based on {@link #successors(Object)}) for full
 * edges() implementation.
 */
@Override
protected long edgeCount() {
 return delegate().edges().size();
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

 private static <N, V> Map<EndpointPair<N>, V> edgeValueMap(final ValueGraph<N, V> graph) {
  Function<EndpointPair<N>, V> edgeToValueFn =
    new Function<EndpointPair<N>, V>() {
     @Override
     public V apply(EndpointPair<N> edge) {
      return graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null);
     }
    };
  return Maps.asMap(graph.edges(), edgeToValueFn);
 }
}
origin: org.jboss.eap/wildfly-client-all

private ImmutableValueGraph(ValueGraph<N, V> graph) {
 super(ValueGraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size());
}
origin: org.jboss.eap/wildfly-client-all

/** Creates a mutable copy of {@code graph} with the same nodes, edges, and edge values. */
public static <N, V> MutableValueGraph<N, V> copyOf(ValueGraph<N, V> graph) {
 MutableValueGraph<N, V> copy =
   ValueGraphBuilder.from(graph).expectedNodeCount(graph.nodes().size()).build();
 for (N node : graph.nodes()) {
  copy.addNode(node);
 }
 for (EndpointPair<N> edge : graph.edges()) {
  copy.putEdgeValue(
    edge.nodeU(), edge.nodeV(), graph.edgeValueOrDefault(edge.nodeU(), edge.nodeV(), null));
 }
 return copy;
}
com.google.common.graphValueGraphedges

Javadoc

Returns all edges in this graph.

Popular methods of ValueGraph

  • nodes
    Returns all nodes in this graph, in the order specified by #nodeOrder().
  • adjacentNodes
    Returns the nodes which have an incident edge in common with node in this graph.
  • edgeValue
    Returns the value of the edge connecting nodeU to nodeV, if one is present; otherwise, returns Optio
  • allowsSelfLoops
    Returns true if this graph allows self-loops (edges that connect a node to itself). Attempting to ad
  • outDegree
    Returns the count of node's outgoing edges (equal to successors(node).size()) in a directed graph. I
  • degree
    Returns the count of node's incident edges, counting self-loops twice (equivalently, the number of t
  • edgeValueOrDefault
    Returns the value of the edge connecting nodeU to nodeV, if one is present; otherwise, returns defau
  • inDegree
    Returns the count of node's incoming edges (equal to predecessors(node).size()) in a directed graph.
  • isDirected
    Returns true if the edges in this graph are directed. Directed edges connect a EndpointPair#source()
  • hasEdgeConnecting
    Returns true if there is an edge directly connecting nodeU to nodeV. This is equivalent to nodes().c
  • nodeOrder
    Returns the order of iteration for the elements of #nodes().
  • predecessors
  • nodeOrder,
  • predecessors,
  • successors,
  • asGraph,
  • equals,
  • incidentEdges

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Notification (javax.management)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now