private void addDirectionalEdge ( Edge e ) { if ( edgeAccess . getCapacity ( ) < getEdgeIndex ( edgePos ) + EDGE_SIZE ) edgeAccess . ensureCapacity ( edgeAccess . getCapacity ( ) + INITIAL_EDGE_FILE_SIZE ) ; long fromId = nodIdMapping . get ( e . getFromNodeId ( ) ) ; long toId = nodIdMapping . get ( e . getToNodeId ( ) ) ; long fromIndex = getNodeIndex ( fromId ) ; long toIndex = getNodeIndex ( toId ) ; long edgeIndex = getEdgeIndex ( edgePos ) ; edgeAccess . setLong ( edgeIndex , fromId ) ; edgeAccess . setLong ( edgeIndex + 8 , toId ) ; edgeAccess . setDouble ( edgeIndex + 16 , e . getWeight ( ) ) ; edgeAccess . setLong ( edgeIndex + 24 , nodeAccess . getLong ( fromIndex + 8 ) ) ; edgeAccess . setLong ( edgeIndex + 32 , nodeAccess . getLong ( toIndex + 16 ) ) ; nodeAccess . setLong ( fromIndex + 8 , edgePos ) ; nodeAccess . setLong ( toIndex + 16 , edgePos ) ; edgeAccess . setLong ( 0 , ++ edgePos ) ; }
Add a new directional edge into the graph .