Logo Search packages:      
Sourcecode: libjgrapht-java version File versions  Download package

Edge org::_3pq::jgrapht::graph::AbstractBaseGraph::DirectedSpecifics::getEdge ( Object  sourceVertex,
Object  targetVertex 
) [inline, virtual]

See also:
Graph::getEdge(Object, Object)

Implements org::_3pq::jgrapht::graph::AbstractBaseGraph::Specifics.

Definition at line 735 of file AbstractBaseGraph.java.

References org::_3pq::jgrapht::graph::AbstractBaseGraph::containsVertex(), getEdgeContainer(), org::_3pq::jgrapht::Edge::getTarget(), and org::_3pq::jgrapht::graph::AbstractBaseGraph::DirectedEdgeContainer::m_outgoing.

                                                                        {
            if( containsVertex( sourceVertex )
                    && containsVertex( targetVertex ) ) {
                DirectedEdgeContainer ec = getEdgeContainer( sourceVertex );

                Iterator              iter = ec.m_outgoing.iterator(  );

                while( iter.hasNext(  ) ) {
                    Edge e = (Edge) iter.next(  );

                    if( e.getTarget(  ).equals( targetVertex ) ) {
                        return e;
                    }
                }
            }

            return null;
        }


Generated by  Doxygen 1.6.0   Back to index