Tabnine Logo
EndpointPairIterator$Undirected
Code IndexAdd Tabnine to your IDE (free)

How to use
EndpointPairIterator$Undirected
in
com.google.common.graph

Best Java code snippets using com.google.common.graph.EndpointPairIterator$Undirected (Showing top 10 results out of 315)

origin: wildfly/wildfly

 @Override
 protected EndpointPair<N> computeNext() {
  while (true) {
   while (successorIterator.hasNext()) {
    N otherNode = successorIterator.next();
    if (!visitedNodes.contains(otherNode)) {
     return EndpointPair.unordered(node, otherNode);
    }
   }
   // Add to visited set *after* processing neighbors so we still include self-loops.
   visitedNodes.add(node);
   if (!advance()) {
    visitedNodes = null;
    return endOfData();
   }
  }
 }
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

 @Override
 protected EndpointPair<N> computeNext() {
  while (true) {
   while (successorIterator.hasNext()) {
    N otherNode = successorIterator.next();
    if (!visitedNodes.contains(otherNode)) {
     return EndpointPair.unordered(node, otherNode);
    }
   }
   // Add to visited set *after* processing neighbors so we still include self-loops.
   visitedNodes.add(node);
   if (!advance()) {
    visitedNodes = null;
    return endOfData();
   }
  }
 }
}
origin: org.jboss.eap/wildfly-client-all

 @Override
 protected EndpointPair<N> computeNext() {
  while (true) {
   while (successorIterator.hasNext()) {
    N otherNode = successorIterator.next();
    if (!visitedNodes.contains(otherNode)) {
     return EndpointPair.unordered(node, otherNode);
    }
   }
   // Add to visited set *after* processing neighbors so we still include self-loops.
   visitedNodes.add(node);
   if (!advance()) {
    visitedNodes = null;
    return endOfData();
   }
  }
 }
}
origin: org.jboss.eap/wildfly-client-all

static <N> EndpointPairIterator<N> of(BaseGraph<N> graph) {
 return graph.isDirected() ? new Directed<N>(graph) : new Undirected<N>(graph);
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

static <N> EndpointPairIterator<N> of(BaseGraph<N> graph) {
 return graph.isDirected() ? new Directed<N>(graph) : new Undirected<N>(graph);
}
origin: wildfly/wildfly

static <N> EndpointPairIterator<N> of(BaseGraph<N> graph) {
 return graph.isDirected() ? new Directed<N>(graph) : new Undirected<N>(graph);
}
origin: google/j2objc

 @Override
 protected EndpointPair<N> computeNext() {
  while (true) {
   while (successorIterator.hasNext()) {
    N otherNode = successorIterator.next();
    if (!visitedNodes.contains(otherNode)) {
     return EndpointPair.unordered(node, otherNode);
    }
   }
   // Add to visited set *after* processing neighbors so we still include self-loops.
   visitedNodes.add(node);
   if (!advance()) {
    visitedNodes = null;
    return endOfData();
   }
  }
 }
}
origin: google/j2objc

static <N> EndpointPairIterator<N> of(BaseGraph<N> graph) {
 return graph.isDirected() ? new Directed<N>(graph) : new Undirected<N>(graph);
}
origin: google/guava

 @Override
 protected EndpointPair<N> computeNext() {
  while (true) {
   while (successorIterator.hasNext()) {
    N otherNode = successorIterator.next();
    if (!visitedNodes.contains(otherNode)) {
     return EndpointPair.unordered(node, otherNode);
    }
   }
   // Add to visited set *after* processing neighbors so we still include self-loops.
   visitedNodes.add(node);
   if (!advance()) {
    visitedNodes = null;
    return endOfData();
   }
  }
 }
}
origin: google/guava

static <N> EndpointPairIterator<N> of(BaseGraph<N> graph) {
 return graph.isDirected() ? new Directed<N>(graph) : new Undirected<N>(graph);
}
com.google.common.graphEndpointPairIterator$Undirected

Javadoc

If the graph is undirected, each unordered [node, otherNode] pair (except self-loops) will be visited twice if there is an edge connecting them. To avoid returning duplicate EndpointPairs, we keep track of the nodes that we have visited. When processing endpoint pairs, we skip if the "other node" is in the visited set, as shown below:
 
Nodes = {N1, N2, N3, N4} 
N2           __ 
/  \         |  | 
N1----N3      N4__| 
Visited Nodes = {} 
EndpointPair [N1, N2] - return 
EndpointPair [N1, N3] - return 
Visited Nodes = {N1} 
EndpointPair [N2, N1] - skip 
EndpointPair [N2, N3] - return 
Visited Nodes = {N1, N2} 
EndpointPair [N3, N1] - skip 
EndpointPair [N3, N2] - skip 
Visited Nodes = {N1, N2, N3} 
EndpointPair [N4, N4] - return 
Visited Nodes = {N1, N2, N3, N4} 

Most used methods

  • <init>
  • advance
  • endOfData

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Menu (java.awt)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • JTable (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 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