Examples of DirectedEdge


Examples of org.geotools.graph.structure.DirectedEdge

   *
   * @see DirectedEdge
   * @see GraphBuilder#addEdge(Edge)
   */
  public void addEdge(Edge edge) {
    DirectedEdge de = (DirectedEdge)edge;
    de.getInNode().addOut(de);
    de.getOutNode().addIn(de);
    getEdges().add(de);
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   */
  public Edge getInEdge(DirectedNode other) {
    //must explictley check that the edge has node other, and one node this,
    // just checking other is not good enough because of loops
    for (int i = 0; i < m_in.size(); i++) {
      DirectedEdge edge = (DirectedEdge)m_in.get(i);
      if (edge.getInNode().equals(other) && edge.getOutNode().equals(this))
        return(edge);
    }
    return(null);
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   */
  public Edge getOutEdge(DirectedNode other) {
    //must explictley check that the edge has node other, and one node this,
    // just checking other is not good enough because of loops
    for (int i = 0; i < m_out.size(); i++) {
      DirectedEdge edge = (DirectedEdge)m_out.get(i);
      if (edge.getOutNode().equals(other) && edge.getInNode().equals(this))
        return(edge);
    }
    return(null);
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see DirectedNode#getInEdges(DirectedNode)
   */
  public List getInEdges(DirectedNode other) {
    ArrayList edges = new ArrayList();
    for (int i = 0; i < m_in.size(); i++) {
      DirectedEdge edge = (DirectedEdge)m_in.get(i);
      if (edge.getInNode().equals(other)) edges.add(edge);
    }
    return(edges);
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see DirectedNode#getOutEdges(DirectedNode)
   */
  public List getOutEdges(DirectedNode other) {
    ArrayList edges = new ArrayList();
    for (int i = 0; i < m_out.size(); i++) {
      DirectedEdge edge = (DirectedEdge)m_out.get(i);
      if (edge.getOutNode().equals(other)) edges.add(edge);
    }
    return(edges);
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see org.geotools.graph.structure.Graphable#getRelated()
   */
  public Iterator getRelated() {
    ArrayList related = new ArrayList(m_out.size()+m_in.size());
    for (int i = 0; i < m_in.size(); i++) {
      DirectedEdge e = (DirectedEdge)m_in.get(i);
      related.add(e.getInNode());
    }
   
    for (int i = 0; i < m_out.size(); i++) {
      DirectedEdge e = (DirectedEdge)m_out.get(i);
      related.add(e.getOutNode());
    }
    return(related.iterator());
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see org.geotools.graph.structure.DirectedGraphable#getInRelated()
   */
  public Iterator getInRelated() {
    ArrayList related = new ArrayList(m_in.size());
    for (int i = 0; i < m_in.size(); i++) {
      DirectedEdge e = (DirectedEdge)m_in.get(i);
      related.add(e.getInNode());
    }
 
    return(related.iterator());
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see org.geotools.graph.structure.DirectedGraphable#getOutRelated()
   */
  public Iterator getOutRelated() {
    ArrayList related = new ArrayList(m_out.size());
    for (int i = 0; i < m_out.size(); i++) {
      DirectedEdge e = (DirectedEdge)m_out.get(i);
      related.add(e.getOutNode());
    }
    return(related.iterator());
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see org.geotools.graph.structure.DirectedGraphable#getInRelated()
   */
  public Iterator getInRelated() {
    ArrayList in = new ArrayList();
    for (Iterator itr = m_in.getInEdges().iterator(); itr.hasNext();) {
      DirectedEdge de = (DirectedEdge)itr.next();
      //this check has to be because the edge could be a loop in which case
      // it is in related to itself
      if (!de.equals(this)) in.add(de)
    }
    return(in.iterator())
  }
View Full Code Here

Examples of org.geotools.graph.structure.DirectedEdge

   * @see org.geotools.graph.structure.DirectedGraphable#getOutRelated()
   */
  public Iterator getOutRelated() {
     ArrayList out = new ArrayList();
    for (Iterator itr = m_out.getOutEdges().iterator(); itr.hasNext();) {
      DirectedEdge de = (DirectedEdge)itr.next();
      //this check has to be because the edge could be a loop in which case
      // it is in related to itself
      if (!de.equals(this)) out.add(de)
    }
    return(out.iterator());   
  }
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.