Tabnine Logo
ConfigurableMutableValueGraph.allowsSelfLoops
Code IndexAdd Tabnine to your IDE (free)

How to use
allowsSelfLoops
method
in
com.google.common.graph.ConfigurableMutableValueGraph

Best Java code snippets using com.google.common.graph.ConfigurableMutableValueGraph.allowsSelfLoops (Showing top 10 results out of 315)

origin: google/guava

@Override
@CanIgnoreReturnValue
public V putEdgeValue(N nodeU, N nodeV, V value) {
 checkNotNull(nodeU, "nodeU");
 checkNotNull(nodeV, "nodeV");
 checkNotNull(value, "value");
 if (!allowsSelfLoops()) {
  checkArgument(!nodeU.equals(nodeV), SELF_LOOPS_NOT_ALLOWED, nodeU);
 }
 GraphConnections<N, V> connectionsU = nodeConnections.get(nodeU);
 if (connectionsU == null) {
  connectionsU = addNodeInternal(nodeU);
 }
 V previousValue = connectionsU.addSuccessor(nodeV, value);
 GraphConnections<N, V> connectionsV = nodeConnections.get(nodeV);
 if (connectionsV == null) {
  connectionsV = addNodeInternal(nodeV);
 }
 connectionsV.addPredecessor(nodeU, value);
 if (previousValue == null) {
  checkPositive(++edgeCount);
 }
 return previousValue;
}
origin: google/j2objc

@Override
@CanIgnoreReturnValue
public V putEdgeValue(N nodeU, N nodeV, V value) {
 checkNotNull(nodeU, "nodeU");
 checkNotNull(nodeV, "nodeV");
 checkNotNull(value, "value");
 if (!allowsSelfLoops()) {
  checkArgument(!nodeU.equals(nodeV), SELF_LOOPS_NOT_ALLOWED, nodeU);
 }
 GraphConnections<N, V> connectionsU = nodeConnections.get(nodeU);
 if (connectionsU == null) {
  connectionsU = addNodeInternal(nodeU);
 }
 V previousValue = connectionsU.addSuccessor(nodeV, value);
 GraphConnections<N, V> connectionsV = nodeConnections.get(nodeV);
 if (connectionsV == null) {
  connectionsV = addNodeInternal(nodeV);
 }
 connectionsV.addPredecessor(nodeU, value);
 if (previousValue == null) {
  checkPositive(++edgeCount);
 }
 return previousValue;
}
origin: wildfly/wildfly

@Override
@CanIgnoreReturnValue
public V putEdgeValue(N nodeU, N nodeV, V value) {
 checkNotNull(nodeU, "nodeU");
 checkNotNull(nodeV, "nodeV");
 checkNotNull(value, "value");
 if (!allowsSelfLoops()) {
  checkArgument(!nodeU.equals(nodeV), SELF_LOOPS_NOT_ALLOWED, nodeU);
 }
 GraphConnections<N, V> connectionsU = nodeConnections.get(nodeU);
 if (connectionsU == null) {
  connectionsU = addNodeInternal(nodeU);
 }
 V previousValue = connectionsU.addSuccessor(nodeV, value);
 GraphConnections<N, V> connectionsV = nodeConnections.get(nodeV);
 if (connectionsV == null) {
  connectionsV = addNodeInternal(nodeV);
 }
 connectionsV.addPredecessor(nodeU, value);
 if (previousValue == null) {
  checkPositive(++edgeCount);
 }
 return previousValue;
}
origin: google/guava

@Override
@CanIgnoreReturnValue
public boolean removeNode(N node) {
 checkNotNull(node, "node");
 GraphConnections<N, V> connections = nodeConnections.get(node);
 if (connections == null) {
  return false;
 }
 if (allowsSelfLoops()) {
  // Remove self-loop (if any) first, so we don't get CME while removing incident edges.
  if (connections.removeSuccessor(node) != null) {
   connections.removePredecessor(node);
   --edgeCount;
  }
 }
 for (N successor : connections.successors()) {
  nodeConnections.getWithoutCaching(successor).removePredecessor(node);
  --edgeCount;
 }
 if (isDirected()) { // In undirected graphs, the successor and predecessor sets are equal.
  for (N predecessor : connections.predecessors()) {
   checkState(nodeConnections.getWithoutCaching(predecessor).removeSuccessor(node) != null);
   --edgeCount;
  }
 }
 nodeConnections.remove(node);
 checkNonNegative(edgeCount);
 return true;
}
origin: google/j2objc

@Override
@CanIgnoreReturnValue
public boolean removeNode(N node) {
 checkNotNull(node, "node");
 GraphConnections<N, V> connections = nodeConnections.get(node);
 if (connections == null) {
  return false;
 }
 if (allowsSelfLoops()) {
  // Remove self-loop (if any) first, so we don't get CME while removing incident edges.
  if (connections.removeSuccessor(node) != null) {
   connections.removePredecessor(node);
   --edgeCount;
  }
 }
 for (N successor : connections.successors()) {
  nodeConnections.getWithoutCaching(successor).removePredecessor(node);
  --edgeCount;
 }
 if (isDirected()) { // In undirected graphs, the successor and predecessor sets are equal.
  for (N predecessor : connections.predecessors()) {
   checkState(nodeConnections.getWithoutCaching(predecessor).removeSuccessor(node) != null);
   --edgeCount;
  }
 }
 nodeConnections.remove(node);
 checkNonNegative(edgeCount);
 return true;
}
origin: wildfly/wildfly

@Override
@CanIgnoreReturnValue
public boolean removeNode(N node) {
 checkNotNull(node, "node");
 GraphConnections<N, V> connections = nodeConnections.get(node);
 if (connections == null) {
  return false;
 }
 if (allowsSelfLoops()) {
  // Remove self-loop (if any) first, so we don't get CME while removing incident edges.
  if (connections.removeSuccessor(node) != null) {
   connections.removePredecessor(node);
   --edgeCount;
  }
 }
 for (N successor : connections.successors()) {
  nodeConnections.getWithoutCaching(successor).removePredecessor(node);
  --edgeCount;
 }
 if (isDirected()) { // In undirected graphs, the successor and predecessor sets are equal.
  for (N predecessor : connections.predecessors()) {
   checkState(nodeConnections.getWithoutCaching(predecessor).removeSuccessor(node) != null);
   --edgeCount;
  }
 }
 nodeConnections.remove(node);
 checkNonNegative(edgeCount);
 return true;
}
origin: org.jboss.eap/wildfly-client-all

@Override
@CanIgnoreReturnValue
public V putEdgeValue(N nodeU, N nodeV, V value) {
 checkNotNull(nodeU, "nodeU");
 checkNotNull(nodeV, "nodeV");
 checkNotNull(value, "value");
 if (!allowsSelfLoops()) {
  checkArgument(!nodeU.equals(nodeV), SELF_LOOPS_NOT_ALLOWED, nodeU);
 }
 GraphConnections<N, V> connectionsU = nodeConnections.get(nodeU);
 if (connectionsU == null) {
  connectionsU = addNodeInternal(nodeU);
 }
 V previousValue = connectionsU.addSuccessor(nodeV, value);
 GraphConnections<N, V> connectionsV = nodeConnections.get(nodeV);
 if (connectionsV == null) {
  connectionsV = addNodeInternal(nodeV);
 }
 connectionsV.addPredecessor(nodeU, value);
 if (previousValue == null) {
  checkPositive(++edgeCount);
 }
 return previousValue;
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
@CanIgnoreReturnValue
public V putEdgeValue(N nodeU, N nodeV, V value) {
 checkNotNull(nodeU, "nodeU");
 checkNotNull(nodeV, "nodeV");
 checkNotNull(value, "value");
 if (!allowsSelfLoops()) {
  checkArgument(!nodeU.equals(nodeV), SELF_LOOPS_NOT_ALLOWED, nodeU);
 }
 GraphConnections<N, V> connectionsU = nodeConnections.get(nodeU);
 if (connectionsU == null) {
  connectionsU = addNodeInternal(nodeU);
 }
 V previousValue = connectionsU.addSuccessor(nodeV, value);
 GraphConnections<N, V> connectionsV = nodeConnections.get(nodeV);
 if (connectionsV == null) {
  connectionsV = addNodeInternal(nodeV);
 }
 connectionsV.addPredecessor(nodeU, value);
 if (previousValue == null) {
  checkPositive(++edgeCount);
 }
 return previousValue;
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
@CanIgnoreReturnValue
public boolean removeNode(N node) {
 checkNotNull(node, "node");
 GraphConnections<N, V> connections = nodeConnections.get(node);
 if (connections == null) {
  return false;
 }
 if (allowsSelfLoops()) {
  // Remove self-loop (if any) first, so we don't get CME while removing incident edges.
  if (connections.removeSuccessor(node) != null) {
   connections.removePredecessor(node);
   --edgeCount;
  }
 }
 for (N successor : connections.successors()) {
  nodeConnections.getWithoutCaching(successor).removePredecessor(node);
  --edgeCount;
 }
 if (isDirected()) { // In undirected graphs, the successor and predecessor sets are equal.
  for (N predecessor : connections.predecessors()) {
   checkState(nodeConnections.getWithoutCaching(predecessor).removeSuccessor(node) != null);
   --edgeCount;
  }
 }
 nodeConnections.remove(node);
 checkNonNegative(edgeCount);
 return true;
}
origin: org.jboss.eap/wildfly-client-all

@Override
@CanIgnoreReturnValue
public boolean removeNode(N node) {
 checkNotNull(node, "node");
 GraphConnections<N, V> connections = nodeConnections.get(node);
 if (connections == null) {
  return false;
 }
 if (allowsSelfLoops()) {
  // Remove self-loop (if any) first, so we don't get CME while removing incident edges.
  if (connections.removeSuccessor(node) != null) {
   connections.removePredecessor(node);
   --edgeCount;
  }
 }
 for (N successor : connections.successors()) {
  nodeConnections.getWithoutCaching(successor).removePredecessor(node);
  --edgeCount;
 }
 if (isDirected()) { // In undirected graphs, the successor and predecessor sets are equal.
  for (N predecessor : connections.predecessors()) {
   checkState(nodeConnections.getWithoutCaching(predecessor).removeSuccessor(node) != null);
   --edgeCount;
  }
 }
 nodeConnections.remove(node);
 checkNonNegative(edgeCount);
 return true;
}
com.google.common.graphConfigurableMutableValueGraphallowsSelfLoops

Popular methods of ConfigurableMutableValueGraph

  • <init>
    Constructs a mutable graph with the properties specified in builder.
  • addNodeInternal
    Adds node to the graph and returns the associated GraphConnections.
  • containsNode
  • isDirected
  • newConnections
  • putEdgeValue
  • removeEdge
  • validateEndpoints

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top 12 Jupyter Notebook extensions
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