@Override public final Incidence getNextIncidenceAtVertex(Graph traversalContext, Direction direction) { Incidence i; try { i = localGraphDatabase.getIncidenceObject( storingGraphDatabase.getNextIncidenceIdAtVertexId(id)); } catch (RemoteException e) { throw new RuntimeException(e); } if (traversalContext == null) { while (((i != null) && (direction != null) && (direction != Direction.BOTH) && (direction != i.getDirection()))) { i = i.getNextIncidenceAtVertex(); } } else { if ((direction != null) && (direction != Direction.BOTH)) { while ((i != null) && ((!traversalContext.containsEdge(i.getEdge())) || (direction != i.getDirection()))) { i = i.getNextIncidenceAtVertex(); } } else { while ((i != null) && (!traversalContext.containsEdge(i.getEdge()))) { i = i.getNextIncidenceAtVertex(); } } } return i; }
@Override public final Incidence getNextIncidenceAtVertex(Graph traversalContext) { Incidence currentIncidence; try { long nextIncId = storingGraphDatabase.getNextIncidenceIdAtVertexId(id); currentIncidence = localGraphDatabase.getIncidenceObject(nextIncId); } catch (RemoteException e) { throw new RuntimeException(e); } while ((traversalContext != null) && (currentIncidence != null) && (!traversalContext.containsEdge(currentIncidence.getEdge()))) { currentIncidence = currentIncidence.getNextIncidenceAtVertex(); } return currentIncidence; }
@Override public final Incidence getNextIncidenceAtVertex(Direction direction) { if (getGraph().getTraversalContext() == null) { Incidence i; try { i = localGraphDatabase.getIncidenceObject( storingGraphDatabase.getNextIncidenceIdAtVertexId(id)); } catch (RemoteException e) { throw new RuntimeException(e); } if ((direction != null) && (direction != Direction.BOTH)) { while ((i != null) && (direction != i.getDirection())) { i = i.getNextIncidenceAtVertex(); } } return i; } else { return getNextIncidenceAtVertex(getGraph().getTraversalContext(), direction); } }