@Override public Vertex getVertex() { try { return localGraphDatabase.getVertexObject(storingGraphDatabase.getVertexIdAtIncidenceId(id)); } catch (RemoteException e) { throw new RuntimeException(e); } }
@Override public Iterable<Edge> getThoseEdges(Graph traversalContext) { Vertex vertex; try { vertex = localGraphDatabase.getVertexObject(storingGraphDatabase.getVertexIdAtIncidenceId(id)); } catch (RemoteException e) { throw new RuntimeException(e); } assert getGraph().getTraversalContext() == null || getGraph().getTraversalContext().containsVertex(vertex); return vertex.getIncidentEdges(traversalContext, getDirection().getOppositeDirection()); }
@Override public Incidence getPreviousIncidenceAtVertex(Graph traversalContext) { Incidence currentIncidence; try { currentIncidence = localGraphDatabase.getIncidenceObject( storingGraphDatabase.getPreviousIncidenceIdAtVertexId( storingGraphDatabase.getVertexIdAtIncidenceId(id))); } catch (RemoteException e) { throw new RuntimeException(e); } while ((traversalContext != null) && (currentIncidence != null) && (!traversalContext.containsEdge(currentIncidence.getEdge()))) { currentIncidence = currentIncidence.getPreviousIncidenceAtVertex(); } return currentIncidence; }
@Override public Vertex getThis(Graph traversalContext) { try { if (!localGraphDatabase .getEdgeObject(storingGraphDatabase.getEdgeIdAtIncidenceId(id)) .isBinary()) { throw new UnsupportedOperationException("This method is only supported by binary Edges."); } else { Vertex vertex = localGraphDatabase.getVertexObject(storingGraphDatabase.getVertexIdAtIncidenceId(id)); if (getGraph().getTraversalContext() == null || getGraph().getTraversalContext().containsVertex(vertex)) { return vertex; } else { return null; } } } catch (RemoteException e) { throw new RuntimeException(e); } }