final int internalEdgeAdd ( int newEdgeId , int nodeA , int nodeB ) { writeEdge ( newEdgeId , nodeA , nodeB , EdgeIterator . NO_EDGE , EdgeIterator . NO_EDGE ) ; long edgePointer = toPointer ( newEdgeId ) ; int edge = getEdgeRef ( nodeA ) ; if ( edge > EdgeIterator . NO_EDGE ) edges . setInt ( E_LINKA + edgePointer , edge ) ; setEdgeRef ( nodeA , newEdgeId ) ; if ( nodeA != nodeB ) { edge = getEdgeRef ( nodeB ) ; if ( edge > EdgeIterator . NO_EDGE ) edges . setInt ( E_LINKB + edgePointer , edge ) ; setEdgeRef ( nodeB , newEdgeId ) ; } return newEdgeId ; }
Writes a new edge to the array of edges and adds it to the linked list of edges at nodeA and nodeB