public boolean addEdge ( Edge < T > e ) { if ( e . getFrom ( ) == this ) outgoingEdges . add ( e ) ; else if ( e . getTo ( ) == this ) incomingEdges . add ( e ) ; else return false ; return true ; }
Add an edge to the vertex . If edge . from is this vertex its an outgoing edge . If edge . to is this vertex its an incoming edge . If neither from or to is this vertex the edge is not added .