congrats Icon
New! Announcing our next generation AI code completions
Read here
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

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Notification (javax.management)
  • JComboBox (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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