Tabnine Logo
NetworkConnections
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: google/guava

if (!allowsParallelEdges()) {
 checkArgument(
   !(connectionsU != null && connectionsU.successors().contains(nodeV)),
   PARALLEL_EDGES_NOT_ALLOWED,
   nodeU,
 connectionsU = addNodeInternal(nodeU);
connectionsU.addOutEdge(edge, nodeV);
NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV);
if (connectionsV == null) {
 connectionsV = addNodeInternal(nodeV);
connectionsV.addInEdge(edge, nodeU, isSelfLoop);
edgeToReferenceNode.put(edge, nodeU);
return true;
origin: google/guava

@Override
@CanIgnoreReturnValue
public boolean removeEdge(E edge) {
 checkNotNull(edge, "edge");
 N nodeU = edgeToReferenceNode.get(edge);
 if (nodeU == null) {
  return false;
 }
 NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU);
 N nodeV = connectionsU.adjacentNode(edge);
 NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV);
 connectionsU.removeOutEdge(edge);
 connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV));
 edgeToReferenceNode.remove(edge);
 return true;
}
origin: google/guava

@Override
public Set<N> adjacentNodes(N node) {
 return checkedConnections(node).adjacentNodes();
}
origin: google/guava

@Override
public Set<E> incidentEdges(N node) {
 return checkedConnections(node).incidentEdges();
}
origin: google/guava

@Override
public Set<E> edgesConnecting(N nodeU, N nodeV) {
 NetworkConnections<N, E> connectionsU = checkedConnections(nodeU);
 if (!allowsSelfLoops && nodeU == nodeV) { // just an optimization, only check reference equality
  return ImmutableSet.of();
 }
 checkArgument(containsNode(nodeV), NODE_NOT_IN_GRAPH, nodeV);
 return connectionsU.edgesConnecting(nodeV);
}
origin: google/guava

@Override
public EndpointPair<N> incidentNodes(E edge) {
 N nodeU = checkedReferenceNode(edge);
 N nodeV = nodeConnections.get(nodeU).adjacentNode(edge);
 return EndpointPair.of(this, nodeU, nodeV);
}
origin: google/guava

@Override
public Set<E> outEdges(N node) {
 return checkedConnections(node).outEdges();
}
origin: google/guava

@Override
public Set<N> predecessors(N node) {
 return checkedConnections(node).predecessors();
}
origin: google/guava

@Override
public Set<E> inEdges(N node) {
 return checkedConnections(node).inEdges();
}
origin: google/j2objc

@Override
public Set<E> incidentEdges(N node) {
 return checkedConnections(node).incidentEdges();
}
origin: google/j2objc

@Override
public Set<E> edgesConnecting(N nodeU, N nodeV) {
 NetworkConnections<N, E> connectionsU = checkedConnections(nodeU);
 if (!allowsSelfLoops && nodeU == nodeV) { // just an optimization, only check reference equality
  return ImmutableSet.of();
 }
 checkArgument(containsNode(nodeV), NODE_NOT_IN_GRAPH, nodeV);
 return connectionsU.edgesConnecting(nodeV);
}
origin: google/j2objc

@Override
public EndpointPair<N> incidentNodes(E edge) {
 N nodeU = checkedReferenceNode(edge);
 N nodeV = nodeConnections.get(nodeU).adjacentNode(edge);
 return EndpointPair.of(this, nodeU, nodeV);
}
origin: google/j2objc

@Override
public Set<E> outEdges(N node) {
 return checkedConnections(node).outEdges();
}
origin: google/j2objc

@Override
public Set<N> predecessors(N node) {
 return checkedConnections(node).predecessors();
}
origin: google/j2objc

@Override
public Set<E> inEdges(N node) {
 return checkedConnections(node).inEdges();
}
origin: google/j2objc

@Override
@CanIgnoreReturnValue
public boolean removeEdge(E edge) {
 checkNotNull(edge, "edge");
 N nodeU = edgeToReferenceNode.get(edge);
 if (nodeU == null) {
  return false;
 }
 NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU);
 N nodeV = connectionsU.adjacentNode(edge);
 NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV);
 connectionsU.removeOutEdge(edge);
 connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV));
 edgeToReferenceNode.remove(edge);
 return true;
}
origin: google/j2objc

if (!allowsParallelEdges()) {
 checkArgument(
   !(connectionsU != null && connectionsU.successors().contains(nodeV)),
   PARALLEL_EDGES_NOT_ALLOWED,
   nodeU,
 connectionsU = addNodeInternal(nodeU);
connectionsU.addOutEdge(edge, nodeV);
NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV);
if (connectionsV == null) {
 connectionsV = addNodeInternal(nodeV);
connectionsV.addInEdge(edge, nodeU, isSelfLoop);
edgeToReferenceNode.put(edge, nodeU);
return true;
origin: wildfly/wildfly

@Override
public Set<E> incidentEdges(N node) {
 return checkedConnections(node).incidentEdges();
}
origin: wildfly/wildfly

@Override
public Set<E> edgesConnecting(N nodeU, N nodeV) {
 NetworkConnections<N, E> connectionsU = checkedConnections(nodeU);
 if (!allowsSelfLoops && nodeU == nodeV) { // just an optimization, only check reference equality
  return ImmutableSet.of();
 }
 checkArgument(containsNode(nodeV), NODE_NOT_IN_GRAPH, nodeV);
 return connectionsU.edgesConnecting(nodeV);
}
origin: wildfly/wildfly

@Override
public EndpointPair<N> incidentNodes(E edge) {
 N nodeU = checkedReferenceNode(edge);
 N nodeV = nodeConnections.get(nodeU).adjacentNode(edge);
 return EndpointPair.of(this, nodeU, nodeV);
}
com.google.common.graphNetworkConnections

Javadoc

An interface for representing and manipulating an origin node's adjacent nodes and incident edges in a Network.

Most used methods

  • addInEdge
    Add edge to the set of incoming edges. Implicitly adds node as a predecessor.
  • addOutEdge
    Add edge to the set of outgoing edges. Implicitly adds node as a successor.
  • adjacentNode
    Returns the node that is adjacent to the origin node along edge.In the directed case, edge is assume
  • adjacentNodes
  • edgesConnecting
    Returns the set of edges connecting the origin node to node. For networks without parallel edges, th
  • inEdges
  • incidentEdges
  • outEdges
  • predecessors
  • removeInEdge
    Remove edge from the set of incoming edges. Returns the former predecessor node. In the undirected c
  • removeOutEdge
    Remove edge from the set of outgoing edges. Returns the former successor node.
  • successors
  • removeOutEdge,
  • successors

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JFrame (javax.swing)
  • JPanel (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Best IntelliJ 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