Examples of DirectedNode


Examples of org.geotools.graph.structure.DirectedNode

    //remove edge from adjacent nodes
    m_in.removeOut(this);
    m_out.removeIn(this);
   
    //swap nodes
    DirectedNode tmp = m_in;
    m_in = m_out;
    m_out = tmp;
  
    //re add nodes
    m_in.addOut(this);
View Full Code Here

Examples of org.geotools.graph.structure.DirectedNode

    assertTrue(built.getEdges().size() == n);
    assertTrue(built.getNodes().size() == n+1);
   
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        DirectedNode node = (DirectedNode)component;
        Coordinate c = (Coordinate)node.getObject();
       
        if (node.getDegree() == 1) {
          assertTrue(
            (node.getID()==0&&node.getInDegree()==0&&node.getOutDegree()==1)||
            (node.getID()==n&&node.getInDegree()==1&&node.getOutDegree()==0)
          );
        }
        else {
          assertTrue(node.getInDegree() == 1 && node.getOutDegree() == 1);
        }
       
        assertTrue(
          c.x == base.x + node.getID() && c.y == base.y + node.getID()
        );
        return(0);
      }
    };
    built.visitNodes(visitor);
View Full Code Here

Examples of org.geotools.graph.structure.DirectedNode

    assertTrue(built.getEdges().size() == n+1);
    assertTrue(built.getNodes().size() == n+1);
   
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        DirectedNode node = (DirectedNode)component;
        assertTrue(node.getInDegree() == 1 && node.getOutDegree() == 1);
        return 0;
      }
    };
  }
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.