Examples of DepthFirstIterator


Examples of org.geotools.graph.traverse.standard.DepthFirstIterator

    // sources
   
    try {
      m_nvisited = m_graph.getNodes().size();
     
      DepthFirstIterator iterator = new DepthFirstIterator();
      BasicGraphTraversal traversal = new BasicGraphTraversal(
        m_graph, this, iterator
      );
     
      Iterator sources = m_graph.getNodes().iterator();
     
      traversal.init();
      m_partition = new ArrayList();
     
      while(m_nvisited > 0) {
       
        //find a node that hasn't been visited and set as source of traversal
        Node source = null;
        while(sources.hasNext() && (source = (Node)sources.next()).isVisited());
      
        //if we could not find a source, return false
        if (source == null || source.isVisited()) return(false);
       
        iterator.setSource(source);
        traversal.traverse();
      }
     
      //create the individual graphs
      HashSet nodes = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.