final void connectNewEdge(int fromNode, int otherNode, int newOrExistingEdge) { int edge = getEdgeRef(fromNode); if (edge > EdgeIterator.NO_EDGE) { long edgePointer = toPointer(newOrExistingEdge); long lastLink = _getLinkPosInEdgeArea(fromNode, otherNode, edgePointer); edges.setInt(lastLink, edge); } setEdgeRef(fromNode, newOrExistingEdge); }
/** * This method disconnects the specified edge from the list of edges of the specified node. It * does not release the freed space to be reused. * <p> * * @param edgeToUpdatePointer if it is negative then the nextEdgeId will be saved to refToEdges * of nodes */ final long internalEdgeDisconnect(int edgeToRemove, long edgeToUpdatePointer, int baseNode, int adjNode) { long edgeToRemovePointer = toPointer(edgeToRemove); // an edge is shared across the two nodes even if the edge is not in both directions // so we need to know two edge-pointers pointing to the edge before edgeToRemovePointer int nextEdgeId = getEdgeRef(baseNode, adjNode, edgeToRemovePointer); if (edgeToUpdatePointer < 0) { setEdgeRef(baseNode, nextEdgeId); } else { // adjNode is different for the edge we want to update with the new link long link = edges.getInt(edgeToUpdatePointer + E_NODEA) == baseNode ? edgeToUpdatePointer + E_LINKA : edgeToUpdatePointer + E_LINKB; edges.setInt(link, nextEdgeId); } return edgeToRemovePointer; }
final void connectNewEdge(int fromNode, int otherNode, int newOrExistingEdge) { int edge = getEdgeRef(fromNode); if (edge > EdgeIterator.NO_EDGE) { long edgePointer = toPointer(newOrExistingEdge); long lastLink = _getLinkPosInEdgeArea(fromNode, otherNode, edgePointer); edges.setInt(lastLink, edge); } setEdgeRef(fromNode, newOrExistingEdge); }
final void connectNewEdge( int fromNode, int newOrExistingEdge ) { int edge = getEdgeRef(fromNode); if (edge > EdgeIterator.NO_EDGE) { long edgePointer = toPointer(newOrExistingEdge); int otherNode = getOtherNode(fromNode, edgePointer); long lastLink = _getLinkPosInEdgeArea(fromNode, otherNode, edgePointer); edges.setInt(lastLink, edge); } setEdgeRef(fromNode, newOrExistingEdge); }
final void connectNewEdge(int fromNode, int newOrExistingEdge) { int edge = getEdgeRef(fromNode); if (edge > EdgeIterator.NO_EDGE) { long edgePointer = toPointer(newOrExistingEdge); int otherNode = getOtherNode(fromNode, edgePointer); long lastLink = _getLinkPosInEdgeArea(fromNode, otherNode, edgePointer); edges.setInt(lastLink, edge); } setEdgeRef(fromNode, newOrExistingEdge); }
/** * This method disconnects the specified edge from the list of edges of the specified node. It * does not release the freed space to be reused. * <p> * * @param edgeToUpdatePointer if it is negative then the nextEdgeId will be saved to refToEdges * of nodes */ final long internalEdgeDisconnect(int edgeToRemove, long edgeToUpdatePointer, int baseNode, int adjNode) { long edgeToRemovePointer = toPointer(edgeToRemove); // an edge is shared across the two nodes even if the edge is not in both directions // so we need to know two edge-pointers pointing to the edge before edgeToRemovePointer int nextEdgeId = getEdgeRef(baseNode, adjNode, edgeToRemovePointer); if (edgeToUpdatePointer < 0) { setEdgeRef(baseNode, nextEdgeId); } else { // adjNode is different for the edge we want to update with the new link long link = edges.getInt(edgeToUpdatePointer + E_NODEA) == baseNode ? edgeToUpdatePointer + E_LINKA : edgeToUpdatePointer + E_LINKB; edges.setInt(link, nextEdgeId); } return edgeToRemovePointer; }
/** * This method disconnects the specified edge from the list of edges of the specified node. It * does not release the freed space to be reused. * <p> * * @param edgeToUpdatePointer if it is negative then the nextEdgeId will be saved to refToEdges * of nodes */ final long internalEdgeDisconnect(int edgeToRemove, long edgeToUpdatePointer, int baseNode, int adjNode) { long edgeToRemovePointer = toPointer(edgeToRemove); // an edge is shared across the two nodes even if the edge is not in both directions // so we need to know two edge-pointers pointing to the edge before edgeToRemovePointer int nextEdgeId = getEdgeRef(baseNode, adjNode, edgeToRemovePointer); if (edgeToUpdatePointer < 0) { setEdgeRef(baseNode, nextEdgeId); } else { // adjNode is different for the edge we want to update with the new link long link = edges.getInt(edgeToUpdatePointer + E_NODEA) == baseNode ? edgeToUpdatePointer + E_LINKA : edgeToUpdatePointer + E_LINKB; edges.setInt(link, nextEdgeId); } return edgeToRemovePointer; }
/** * This method disconnects the specified edge from the list of edges of the specified node. It * does not release the freed space to be reused. * <p> * @param edgeToUpdatePointer if it is negative then the nextEdgeId will be saved to refToEdges * of nodes */ final long internalEdgeDisconnect( int edgeToRemove, long edgeToUpdatePointer, int baseNode, int adjNode ) { long edgeToRemovePointer = toPointer(edgeToRemove); // an edge is shared across the two nodes even if the edge is not in both directions // so we need to know two edge-pointers pointing to the edge before edgeToRemovePointer int nextEdgeId = getEdgeRef(baseNode, adjNode, edgeToRemovePointer); if (edgeToUpdatePointer < 0) { setEdgeRef(baseNode, nextEdgeId); } else { // adjNode is different for the edge we want to update with the new link long link = edges.getInt(edgeToUpdatePointer + E_NODEA) == baseNode ? edgeToUpdatePointer + E_LINKA : edgeToUpdatePointer + E_LINKB; edges.setInt(link, nextEdgeId); } return edgeToRemovePointer; }