@Override public final CHEdgeIteratorState getEdgeIteratorState(int edgeId, int endNode) { if (isShortcut(edgeId)) { if (!chEdgeAccess.isInBounds(edgeId)) throw new IllegalStateException("shortcutId " + edgeId + " out of bounds"); } else if (!baseGraph.edgeAccess.isInBounds(edgeId)) throw new IllegalStateException("edgeId " + edgeId + " out of bounds"); return (CHEdgeIteratorState) chEdgeAccess.getEdgeProps(edgeId, endNode); }
@Override public void disconnect(CHEdgeExplorer explorer, EdgeIteratorState edgeState) { // search edge with opposite direction but we need to know the previousEdge for the internalEdgeDisconnect so we cannot simply do: // EdgeIteratorState tmpIter = getEdgeProps(iter.getEdge(), iter.getBaseNode()); CHEdgeIterator tmpIter = explorer.setBaseNode(edgeState.getAdjNode()); int tmpPrevEdge = EdgeIterator.NO_EDGE; while (tmpIter.next()) { if (tmpIter.isShortcut() && tmpIter.getEdge() == edgeState.getEdge()) { // TODO this is ugly, move this somehow into the underlying iteration logic long edgePointer = tmpPrevEdge == EdgeIterator.NO_EDGE ? -1 : isShortcut(tmpPrevEdge) ? chEdgeAccess.toPointer(tmpPrevEdge) : baseGraph.edgeAccess.toPointer(tmpPrevEdge); chEdgeAccess.internalEdgeDisconnect(edgeState.getEdge(), edgePointer, edgeState.getAdjNode(), edgeState.getBaseNode()); break; } tmpPrevEdge = tmpIter.getEdge(); } }
@Override public final CHEdgeIteratorState getEdgeIteratorState(int edgeId, int endNode) { if (isShortcut(edgeId)) { if (!chEdgeAccess.isInBounds(edgeId)) throw new IllegalStateException("shortcutId " + edgeId + " out of bounds"); } else if (!baseGraph.edgeAccess.isInBounds(edgeId)) throw new IllegalStateException("edgeId " + edgeId + " out of bounds"); return (CHEdgeIteratorState) chEdgeAccess.getEdgeProps(edgeId, endNode); }
@Override public final CHEdgeIteratorState getEdgeIteratorState(int edgeId, int endNode) { if (isShortcut(edgeId)) { if (!chEdgeAccess.isInBounds(edgeId)) throw new IllegalStateException("shortcutId " + edgeId + " out of bounds"); } else if (!baseGraph.edgeAccess.isInBounds(edgeId)) throw new IllegalStateException("edgeId " + edgeId + " out of bounds"); return (CHEdgeIteratorState) chEdgeAccess.getEdgeProps(edgeId, endNode); }
@Override public final CHEdgeIteratorState getEdgeIteratorState( int edgeId, int endNode ) { if (isShortcut(edgeId)) { if (!chEdgeAccess.isInBounds(edgeId)) throw new IllegalStateException("shortcutId " + edgeId + " out of bounds"); } else { if (!baseGraph.edgeAccess.isInBounds(edgeId)) throw new IllegalStateException("edgeId " + edgeId + " out of bounds"); } return (CHEdgeIteratorState) chEdgeAccess.getEdgeProps(edgeId, endNode); }
/** * Disconnects the edges (higher to lower node) via the specified edgeState pointing from lower to * higher node. * <p> * * @param edgeState the edge from lower to higher */ public void disconnect(CHEdgeExplorer explorer, EdgeIteratorState edgeState) { // search edge with opposite direction but we need to know the previousEdge for the internalEdgeDisconnect so we cannot simply do: // EdgeIteratorState tmpIter = getEdgeProps(iter.getEdge(), iter.getBaseNode()); CHEdgeIterator tmpIter = explorer.setBaseNode(edgeState.getAdjNode()); int tmpPrevEdge = EdgeIterator.NO_EDGE; while (tmpIter.next()) { if (tmpIter.isShortcut() && tmpIter.getEdge() == edgeState.getEdge()) { // TODO this is ugly, move this somehow into the underlying iteration logic long edgePointer = tmpPrevEdge == EdgeIterator.NO_EDGE ? -1 : isShortcut(tmpPrevEdge) ? chEdgeAccess.toPointer(tmpPrevEdge) : baseGraph.edgeAccess.toPointer(tmpPrevEdge); chEdgeAccess.internalEdgeDisconnect(edgeState.getEdge(), edgePointer, edgeState.getAdjNode(), edgeState.getBaseNode()); break; } tmpPrevEdge = tmpIter.getEdge(); } }
/** * Disconnects the edges (higher to lower node) via the specified edgeState pointing from lower to * higher node. * <p> * * @param edgeState the edge from lower to higher */ public void disconnect(CHEdgeExplorer explorer, EdgeIteratorState edgeState) { // search edge with opposite direction but we need to know the previousEdge for the internalEdgeDisconnect so we cannot simply do: // EdgeIteratorState tmpIter = getEdgeProps(iter.getEdge(), iter.getBaseNode()); CHEdgeIterator tmpIter = explorer.setBaseNode(edgeState.getAdjNode()); int tmpPrevEdge = EdgeIterator.NO_EDGE; while (tmpIter.next()) { if (tmpIter.isShortcut() && tmpIter.getEdge() == edgeState.getEdge()) { // TODO this is ugly, move this somehow into the underlying iteration logic long edgePointer = tmpPrevEdge == EdgeIterator.NO_EDGE ? -1 : isShortcut(tmpPrevEdge) ? chEdgeAccess.toPointer(tmpPrevEdge) : baseGraph.edgeAccess.toPointer(tmpPrevEdge); chEdgeAccess.internalEdgeDisconnect(edgeState.getEdge(), edgePointer, edgeState.getAdjNode(), edgeState.getBaseNode()); break; } tmpPrevEdge = tmpIter.getEdge(); } }
/** * Disconnects the edges (higher to lower node) via the specified edgeState pointing from lower to * higher node. * <p> * @param edgeState the edge from lower to higher */ public void disconnect( CHEdgeExplorer explorer, EdgeIteratorState edgeState ) { // search edge with opposite direction but we need to know the previousEdge for the internalEdgeDisconnect so we cannot simply do: // EdgeIteratorState tmpIter = getEdgeProps(iter.getEdge(), iter.getBaseNode()); CHEdgeIterator tmpIter = explorer.setBaseNode(edgeState.getAdjNode()); int tmpPrevEdge = EdgeIterator.NO_EDGE; while (tmpIter.next()) { if (tmpIter.isShortcut() && tmpIter.getEdge() == edgeState.getEdge()) { // TODO this is ugly, move this somehow into the underlying iteration logic long edgePointer = tmpPrevEdge == EdgeIterator.NO_EDGE ? -1 : isShortcut(tmpPrevEdge) ? chEdgeAccess.toPointer(tmpPrevEdge) : baseGraph.edgeAccess.toPointer(tmpPrevEdge); chEdgeAccess.internalEdgeDisconnect(edgeState.getEdge(), edgePointer, edgeState.getAdjNode(), edgeState.getBaseNode()); break; } tmpPrevEdge = tmpIter.getEdge(); } }