congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
DirectedMultiNetworkConnections
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: google/guava

static <N, E> DirectedMultiNetworkConnections<N, E> ofImmutable(
  Map<E, N> inEdges, Map<E, N> outEdges, int selfLoopCount) {
 return new DirectedMultiNetworkConnections<>(
   ImmutableMap.copyOf(inEdges), ImmutableMap.copyOf(outEdges), selfLoopCount);
}
origin: google/guava

private Multiset<N> predecessorsMultiset() {
 Multiset<N> predecessors = getReference(predecessorsReference);
 if (predecessors == null) {
  predecessors = HashMultiset.create(inEdgeMap.values());
  predecessorsReference = new SoftReference<>(predecessors);
 }
 return predecessors;
}
origin: google/guava

@Override
public Set<N> predecessors() {
 return Collections.unmodifiableSet(predecessorsMultiset().elementSet());
}
origin: google/guava

 private NetworkConnections<N, E> newConnections() {
  return isDirected()
    ? allowsParallelEdges()
      ? DirectedMultiNetworkConnections.<N, E>of()
      : DirectedNetworkConnections.<N, E>of()
    : allowsParallelEdges()
      ? UndirectedMultiNetworkConnections.<N, E>of()
      : UndirectedNetworkConnections.<N, E>of();
 }
}
origin: google/guava

@Override
public Set<N> successors() {
 return Collections.unmodifiableSet(successorsMultiset().elementSet());
}
origin: google/guava

private static <N, E> NetworkConnections<N, E> connectionsOf(Network<N, E> network, N node) {
 if (network.isDirected()) {
  Map<E, N> inEdgeMap = Maps.asMap(network.inEdges(node), sourceNodeFn(network));
  Map<E, N> outEdgeMap = Maps.asMap(network.outEdges(node), targetNodeFn(network));
  int selfLoopCount = network.edgesConnecting(node, node).size();
  return network.allowsParallelEdges()
    ? DirectedMultiNetworkConnections.ofImmutable(inEdgeMap, outEdgeMap, selfLoopCount)
    : DirectedNetworkConnections.ofImmutable(inEdgeMap, outEdgeMap, selfLoopCount);
 } else {
  Map<E, N> incidentEdgeMap =
    Maps.asMap(network.incidentEdges(node), adjacentNodeFn(network, node));
  return network.allowsParallelEdges()
    ? UndirectedMultiNetworkConnections.ofImmutable(incidentEdgeMap)
    : UndirectedNetworkConnections.ofImmutable(incidentEdgeMap);
 }
}
origin: google/j2objc

 private NetworkConnections<N, E> newConnections() {
  return isDirected()
    ? allowsParallelEdges()
      ? DirectedMultiNetworkConnections.<N, E>of()
      : DirectedNetworkConnections.<N, E>of()
    : allowsParallelEdges()
      ? UndirectedMultiNetworkConnections.<N, E>of()
      : UndirectedNetworkConnections.<N, E>of();
 }
}
origin: google/j2objc

@Override
public Set<N> successors() {
 return Collections.unmodifiableSet(successorsMultiset().elementSet());
}
origin: google/j2objc

private static <N, E> NetworkConnections<N, E> connectionsOf(Network<N, E> network, N node) {
 if (network.isDirected()) {
  Map<E, N> inEdgeMap = Maps.asMap(network.inEdges(node), sourceNodeFn(network));
  Map<E, N> outEdgeMap = Maps.asMap(network.outEdges(node), targetNodeFn(network));
  int selfLoopCount = network.edgesConnecting(node, node).size();
  return network.allowsParallelEdges()
    ? DirectedMultiNetworkConnections.ofImmutable(inEdgeMap, outEdgeMap, selfLoopCount)
    : DirectedNetworkConnections.ofImmutable(inEdgeMap, outEdgeMap, selfLoopCount);
 } else {
  Map<E, N> incidentEdgeMap =
    Maps.asMap(network.incidentEdges(node), adjacentNodeFn(network, node));
  return network.allowsParallelEdges()
    ? UndirectedMultiNetworkConnections.ofImmutable(incidentEdgeMap)
    : UndirectedNetworkConnections.ofImmutable(incidentEdgeMap);
 }
}
origin: google/guava

private Multiset<N> successorsMultiset() {
 Multiset<N> successors = getReference(successorsReference);
 if (successors == null) {
  successors = HashMultiset.create(outEdgeMap.values());
  successorsReference = new SoftReference<>(successors);
 }
 return successors;
}
origin: google/guava

static <N, E> DirectedMultiNetworkConnections<N, E> of() {
 return new DirectedMultiNetworkConnections<>(
   new HashMap<E, N>(INNER_CAPACITY, INNER_LOAD_FACTOR),
   new HashMap<E, N>(INNER_CAPACITY, INNER_LOAD_FACTOR),
   0);
}
origin: wildfly/wildfly

 private NetworkConnections<N, E> newConnections() {
  return isDirected()
    ? allowsParallelEdges()
      ? DirectedMultiNetworkConnections.<N, E>of()
      : DirectedNetworkConnections.<N, E>of()
    : allowsParallelEdges()
      ? UndirectedMultiNetworkConnections.<N, E>of()
      : UndirectedNetworkConnections.<N, E>of();
 }
}
origin: google/j2objc

@Override
public Set<N> predecessors() {
 return Collections.unmodifiableSet(predecessorsMultiset().elementSet());
}
origin: wildfly/wildfly

@Override
public Set<N> successors() {
 return Collections.unmodifiableSet(successorsMultiset().elementSet());
}
origin: wildfly/wildfly

private static <N, E> NetworkConnections<N, E> connectionsOf(Network<N, E> network, N node) {
 if (network.isDirected()) {
  Map<E, N> inEdgeMap = Maps.asMap(network.inEdges(node), sourceNodeFn(network));
  Map<E, N> outEdgeMap = Maps.asMap(network.outEdges(node), targetNodeFn(network));
  int selfLoopCount = network.edgesConnecting(node, node).size();
  return network.allowsParallelEdges()
    ? DirectedMultiNetworkConnections.ofImmutable(inEdgeMap, outEdgeMap, selfLoopCount)
    : DirectedNetworkConnections.ofImmutable(inEdgeMap, outEdgeMap, selfLoopCount);
 } else {
  Map<E, N> incidentEdgeMap =
    Maps.asMap(network.incidentEdges(node), adjacentNodeFn(network, node));
  return network.allowsParallelEdges()
    ? UndirectedMultiNetworkConnections.ofImmutable(incidentEdgeMap)
    : UndirectedNetworkConnections.ofImmutable(incidentEdgeMap);
 }
}
origin: google/guava

@Override
public void addOutEdge(E edge, N node) {
 super.addOutEdge(edge, node);
 Multiset<N> successors = getReference(successorsReference);
 if (successors != null) {
  checkState(successors.add(node));
 }
}
origin: google/j2objc

static <N, E> DirectedMultiNetworkConnections<N, E> ofImmutable(
  Map<E, N> inEdges, Map<E, N> outEdges, int selfLoopCount) {
 return new DirectedMultiNetworkConnections<>(
   ImmutableMap.copyOf(inEdges), ImmutableMap.copyOf(outEdges), selfLoopCount);
}
origin: org.jboss.eap/wildfly-client-all

 private NetworkConnections<N, E> newConnections() {
  return isDirected()
    ? allowsParallelEdges()
      ? DirectedMultiNetworkConnections.<N, E>of()
      : DirectedNetworkConnections.<N, E>of()
    : allowsParallelEdges()
      ? UndirectedMultiNetworkConnections.<N, E>of()
      : UndirectedNetworkConnections.<N, E>of();
 }
}
origin: wildfly/wildfly

@Override
public Set<N> predecessors() {
 return Collections.unmodifiableSet(predecessorsMultiset().elementSet());
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public Set<N> successors() {
 return Collections.unmodifiableSet(successorsMultiset().elementSet());
}
com.google.common.graphDirectedMultiNetworkConnections

Javadoc

An implementation of NetworkConnections for directed networks with parallel edges.

Most used methods

  • <init>
  • getReference
  • of
  • ofImmutable
  • predecessorsMultiset
  • successorsMultiset

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 17 Plugins for Android Studio
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