예제 #1
0
 @Override
 public Vertex getVertex() {
   try {
     return localGraphDatabase.getVertexObject(storingGraphDatabase.getVertexIdAtIncidenceId(id));
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
예제 #2
0
 @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());
 }
예제 #3
0
 @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;
 }
예제 #4
0
 @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);
   }
 }