private Edge findDirectionalEdge ( Graph g , int u ) { List < Edge > edges = g . edges ( u ) ; if ( edges . size ( ) == 1 ) return null ; Edge first = null ; for ( Edge e : edges ) { Bond b = e . bond ( ) ; if ( b == Bond . UP || b == Bond . DOWN ) { if ( first == null ) first = e ; else if ( ( ( first . either ( ) == e . either ( ) ) == ( first . bond ( ) == b ) ) ) return null ; } } return first ; }
Utility for find the first directional edge incident to a vertex . If there are no directional labels then null is returned .