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

How to use
DirectedGraphConnections
in
com.google.common.graph

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

origin: google/guava

static <N, V> DirectedGraphConnections<N, V> of() {
 // We store predecessors and successors in the same map, so double the initial capacity.
 int initialCapacity = INNER_CAPACITY * 2;
 return new DirectedGraphConnections<>(
   new HashMap<N, Object>(initialCapacity, INNER_LOAD_FACTOR), 0, 0);
}
origin: google/guava

 private GraphConnections<N, V> newConnections() {
  return isDirected()
    ? DirectedGraphConnections.<N, V>of()
    : UndirectedGraphConnections.<N, V>of();
 }
}
origin: google/guava

private static <N> GraphConnections<N, Presence> connectionsOf(Graph<N> graph, N node) {
 Function<Object, Presence> edgeValueFn = Functions.constant(Presence.EDGE_EXISTS);
 return graph.isDirected()
   ? DirectedGraphConnections.ofImmutable(
     graph.predecessors(node), Maps.asMap(graph.successors(node), edgeValueFn))
   : UndirectedGraphConnections.ofImmutable(
     Maps.asMap(graph.adjacentNodes(node), edgeValueFn));
}
origin: google/guava

 private static <N, V> GraphConnections<N, V> connectionsOf(
   final ValueGraph<N, V> graph, final N node) {
  Function<N, V> successorNodeToValueFn =
    new Function<N, V>() {
     @Override
     public V apply(N successorNode) {
      return graph.edgeValueOrDefault(node, successorNode, null);
     }
    };
  return graph.isDirected()
    ? DirectedGraphConnections.ofImmutable(
      graph.predecessors(node), Maps.asMap(graph.successors(node), successorNodeToValueFn))
    : UndirectedGraphConnections.ofImmutable(
      Maps.asMap(graph.adjacentNodes(node), successorNodeToValueFn));
 }
}
origin: google/j2objc

 private static <N, V> GraphConnections<N, V> connectionsOf(
   final ValueGraph<N, V> graph, final N node) {
  Function<N, V> successorNodeToValueFn =
    new Function<N, V>() {
     @Override
     public V apply(N successorNode) {
      return graph.edgeValueOrDefault(node, successorNode, null);
     }
    };
  return graph.isDirected()
    ? DirectedGraphConnections.ofImmutable(
      graph.predecessors(node), Maps.asMap(graph.successors(node), successorNodeToValueFn))
    : UndirectedGraphConnections.ofImmutable(
      Maps.asMap(graph.adjacentNodes(node), successorNodeToValueFn));
 }
}
origin: google/guava

static <N, V> DirectedGraphConnections<N, V> ofImmutable(
  Set<N> predecessors, Map<N, V> successorValues) {
 Map<N, Object> adjacentNodeValues = new HashMap<>();
 adjacentNodeValues.putAll(successorValues);
 for (N predecessor : predecessors) {
  Object value = adjacentNodeValues.put(predecessor, PRED);
  if (value != null) {
   adjacentNodeValues.put(predecessor, new PredAndSucc(value));
  }
 }
 return new DirectedGraphConnections<>(
   ImmutableMap.copyOf(adjacentNodeValues), predecessors.size(), successorValues.size());
}
origin: google/j2objc

 private GraphConnections<N, V> newConnections() {
  return isDirected()
    ? DirectedGraphConnections.<N, V>of()
    : UndirectedGraphConnections.<N, V>of();
 }
}
origin: google/j2objc

private static <N> GraphConnections<N, Presence> connectionsOf(Graph<N> graph, N node) {
 Function<Object, Presence> edgeValueFn = Functions.constant(Presence.EDGE_EXISTS);
 return graph.isDirected()
   ? DirectedGraphConnections.ofImmutable(
     graph.predecessors(node), Maps.asMap(graph.successors(node), edgeValueFn))
   : UndirectedGraphConnections.ofImmutable(
     Maps.asMap(graph.adjacentNodes(node), edgeValueFn));
}
origin: google/j2objc

static <N, V> DirectedGraphConnections<N, V> of() {
 // We store predecessors and successors in the same map, so double the initial capacity.
 int initialCapacity = INNER_CAPACITY * 2;
 return new DirectedGraphConnections<>(
   new HashMap<N, Object>(initialCapacity, INNER_LOAD_FACTOR), 0, 0);
}
origin: wildfly/wildfly

 private GraphConnections<N, V> newConnections() {
  return isDirected()
    ? DirectedGraphConnections.<N, V>of()
    : UndirectedGraphConnections.<N, V>of();
 }
}
origin: wildfly/wildfly

private static <N> GraphConnections<N, Presence> connectionsOf(Graph<N> graph, N node) {
 Function<Object, Presence> edgeValueFn = Functions.constant(Presence.EDGE_EXISTS);
 return graph.isDirected()
   ? DirectedGraphConnections.ofImmutable(
     graph.predecessors(node), Maps.asMap(graph.successors(node), edgeValueFn))
   : UndirectedGraphConnections.ofImmutable(
     Maps.asMap(graph.adjacentNodes(node), edgeValueFn));
}
origin: wildfly/wildfly

static <N, V> DirectedGraphConnections<N, V> of() {
 // We store predecessors and successors in the same map, so double the initial capacity.
 int initialCapacity = INNER_CAPACITY * 2;
 return new DirectedGraphConnections<>(
   new HashMap<N, Object>(initialCapacity, INNER_LOAD_FACTOR), 0, 0);
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

 private GraphConnections<N, V> newConnections() {
  return isDirected()
    ? DirectedGraphConnections.<N, V>of()
    : UndirectedGraphConnections.<N, V>of();
 }
}
origin: wildfly/wildfly

 private static <N, V> GraphConnections<N, V> connectionsOf(
   final ValueGraph<N, V> graph, final N node) {
  Function<N, V> successorNodeToValueFn =
    new Function<N, V>() {
     @Override
     public V apply(N successorNode) {
      return graph.edgeValueOrDefault(node, successorNode, null);
     }
    };
  return graph.isDirected()
    ? DirectedGraphConnections.ofImmutable(
      graph.predecessors(node), Maps.asMap(graph.successors(node), successorNodeToValueFn))
    : UndirectedGraphConnections.ofImmutable(
      Maps.asMap(graph.adjacentNodes(node), successorNodeToValueFn));
 }
}
origin: google/j2objc

static <N, V> DirectedGraphConnections<N, V> ofImmutable(
  Set<N> predecessors, Map<N, V> successorValues) {
 Map<N, Object> adjacentNodeValues = new HashMap<>();
 adjacentNodeValues.putAll(successorValues);
 for (N predecessor : predecessors) {
  Object value = adjacentNodeValues.put(predecessor, PRED);
  if (value != null) {
   adjacentNodeValues.put(predecessor, new PredAndSucc(value));
  }
 }
 return new DirectedGraphConnections<>(
   ImmutableMap.copyOf(adjacentNodeValues), predecessors.size(), successorValues.size());
}
origin: org.jboss.eap/wildfly-client-all

 private GraphConnections<N, V> newConnections() {
  return isDirected()
    ? DirectedGraphConnections.<N, V>of()
    : UndirectedGraphConnections.<N, V>of();
 }
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

private static <N> GraphConnections<N, Presence> connectionsOf(Graph<N> graph, N node) {
 Function<Object, Presence> edgeValueFn = Functions.constant(Presence.EDGE_EXISTS);
 return graph.isDirected()
   ? DirectedGraphConnections.ofImmutable(
     graph.predecessors(node), Maps.asMap(graph.successors(node), edgeValueFn))
   : UndirectedGraphConnections.ofImmutable(
     Maps.asMap(graph.adjacentNodes(node), edgeValueFn));
}
origin: wildfly/wildfly

static <N, V> DirectedGraphConnections<N, V> ofImmutable(
  Set<N> predecessors, Map<N, V> successorValues) {
 Map<N, Object> adjacentNodeValues = new HashMap<>();
 adjacentNodeValues.putAll(successorValues);
 for (N predecessor : predecessors) {
  Object value = adjacentNodeValues.put(predecessor, PRED);
  if (value != null) {
   adjacentNodeValues.put(predecessor, new PredAndSucc(value));
  }
 }
 return new DirectedGraphConnections<>(
   ImmutableMap.copyOf(adjacentNodeValues), predecessors.size(), successorValues.size());
}
origin: org.jboss.eap/wildfly-client-all

private static <N> GraphConnections<N, Presence> connectionsOf(Graph<N> graph, N node) {
 Function<Object, Presence> edgeValueFn = Functions.constant(Presence.EDGE_EXISTS);
 return graph.isDirected()
   ? DirectedGraphConnections.ofImmutable(
     graph.predecessors(node), Maps.asMap(graph.successors(node), edgeValueFn))
   : UndirectedGraphConnections.ofImmutable(
     Maps.asMap(graph.adjacentNodes(node), edgeValueFn));
}
origin: org.jboss.eap/wildfly-client-all

static <N, V> DirectedGraphConnections<N, V> of() {
 // We store predecessors and successors in the same map, so double the initial capacity.
 int initialCapacity = INNER_CAPACITY * 2;
 return new DirectedGraphConnections<>(
   new HashMap<N, Object>(initialCapacity, INNER_LOAD_FACTOR), 0, 0);
}
com.google.common.graphDirectedGraphConnections

Javadoc

An implementation of GraphConnections for directed graphs.

Most used methods

  • <init>
  • of
  • ofImmutable

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • BoxLayout (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • 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