Codota Logo
DirectedGraphConnections
Code IndexAdd Codota 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)

  • Common ways to obtain DirectedGraphConnections
private void myMethod () {
DirectedGraphConnections d =
  • Codota Iconnew DirectedGraphConnections<>(new HashMap<N, Object>(capacity, loadFactor), float2, 0)
  • Codota IconMap map;Set set;Map map2;new DirectedGraphConnections<>(ImmutableMap.copyOf(map), set.size(), map2.size())
  • Smart code suggestions by Codota
}
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

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now