Tabnine Logo
ValueGraph.inDegree
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: google/guava

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}
origin: google/guava

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}
origin: google/j2objc

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}
origin: google/j2objc

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}
origin: wildfly/wildfly

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}
origin: wildfly/wildfly

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}
origin: google/guava

@Test
public void transpose_directedValueGraph() {
 MutableValueGraph<Integer, String> directedGraph =
   ValueGraphBuilder.directed().allowsSelfLoops(true).build();
 directedGraph.putEdgeValue(N1, N3, E13);
 directedGraph.putEdgeValue(N3, N1, E31);
 directedGraph.putEdgeValue(N1, N2, E12);
 directedGraph.putEdgeValue(N1, N1, E11);
 directedGraph.putEdgeValue(N3, N4, E34);
 MutableValueGraph<Integer, String> expectedTranspose =
   ValueGraphBuilder.directed().allowsSelfLoops(true).build();
 expectedTranspose.putEdgeValue(N3, N1, E13);
 expectedTranspose.putEdgeValue(N1, N3, E31);
 expectedTranspose.putEdgeValue(N2, N1, E12);
 expectedTranspose.putEdgeValue(N1, N1, E11);
 expectedTranspose.putEdgeValue(N4, N3, E34);
 ValueGraph<Integer, String> transpose = transpose(directedGraph);
 assertThat(transpose).isEqualTo(expectedTranspose);
 assertThat(transpose(transpose)).isSameAs(directedGraph);
 AbstractGraphTest.validateGraph(transpose.asGraph());
 assertThat(transpose.edgeValueOrDefault(N1, N2, null)).isNull();
 for (Integer node : directedGraph.nodes()) {
  assertThat(directedGraph.inDegree(node)).isSameAs(transpose.outDegree(node));
  assertThat(directedGraph.outDegree(node)).isSameAs(transpose.inDegree(node));
 }
 directedGraph.putEdgeValue(N2, N1, E21);
 // View should be updated.
 assertThat(transpose.edgeValueOrDefault(N1, N2, null)).isEqualTo(E21);
 AbstractGraphTest.validateGraph(transpose.asGraph());
}
origin: com.io7m.jgrapht/jgrapht-guava

@Override
public int inDegreeOf(V vertex)
{
  return valueGraph.inDegree(vertex);
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}
origin: org.jboss.eap/wildfly-client-all

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}
origin: org.jboss.eap/wildfly-client-all

@Override
public int outDegree(N node) {
 return delegate().inDegree(node); // transpose
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public int inDegree(N node) {
 return delegate().inDegree(node);
}
origin: com.google.guava/guava-tests

@Test
public void transpose_directedValueGraph() {
 MutableValueGraph<Integer, String> directedGraph =
   ValueGraphBuilder.directed().allowsSelfLoops(true).build();
 directedGraph.putEdgeValue(N1, N3, E13);
 directedGraph.putEdgeValue(N3, N1, E31);
 directedGraph.putEdgeValue(N1, N2, E12);
 directedGraph.putEdgeValue(N1, N1, E11);
 directedGraph.putEdgeValue(N3, N4, E34);
 MutableValueGraph<Integer, String> expectedTranspose =
   ValueGraphBuilder.directed().allowsSelfLoops(true).build();
 expectedTranspose.putEdgeValue(N3, N1, E13);
 expectedTranspose.putEdgeValue(N1, N3, E31);
 expectedTranspose.putEdgeValue(N2, N1, E12);
 expectedTranspose.putEdgeValue(N1, N1, E11);
 expectedTranspose.putEdgeValue(N4, N3, E34);
 ValueGraph<Integer, String> transpose = transpose(directedGraph);
 assertThat(transpose).isEqualTo(expectedTranspose);
 assertThat(transpose(transpose)).isSameAs(directedGraph);
 AbstractGraphTest.validateGraph(transpose.asGraph());
 assertThat(transpose.edgeValueOrDefault(N1, N2, null)).isNull();
 for (Integer node : directedGraph.nodes()) {
  assertThat(directedGraph.inDegree(node)).isSameAs(transpose.outDegree(node));
  assertThat(directedGraph.outDegree(node)).isSameAs(transpose.inDegree(node));
 }
 directedGraph.putEdgeValue(N2, N1, E21);
 // View should be updated.
 assertThat(transpose.edgeValueOrDefault(N1, N2, null)).isEqualTo(E21);
 AbstractGraphTest.validateGraph(transpose.asGraph());
}
com.google.common.graphValueGraphinDegree

Javadoc

Returns the count of node's incoming edges (equal to predecessors(node).size()) in a directed graph. In an undirected graph, returns the #degree(Object).

If the count is greater than Integer.MAX_VALUE, returns Integer.MAX_VALUE.

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
  • edges
    Returns all edges in this graph.
  • 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
  • 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

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Sublime Text plugins
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