Ejemplo n.º 1
0
 @Override
 public final Incidence getNextIncidenceAtEdge(Graph traversalContext, Direction direction) {
   Incidence i;
   try {
     i =
         localGraphDatabase.getIncidenceObject(
             storingGraphDatabase.getNextIncidenceIdAtEdgeId(id));
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
   if (traversalContext == null) {
     while (((i != null)
         && (direction != null)
         && (direction != Direction.BOTH)
         && (direction != i.getDirection()))) {
       i = i.getNextIncidenceAtEdge();
     }
   } else {
     if ((direction != null) && (direction != Direction.BOTH)) {
       while ((i != null)
           && ((!traversalContext.containsVertex(i.getVertex()))
               || (direction != i.getDirection()))) {
         i = i.getNextIncidenceAtEdge();
       }
     } else {
       while ((i != null) && (!traversalContext.containsVertex(i.getVertex()))) {
         i = i.getNextIncidenceAtEdge();
       }
     }
   }
   return i;
 }
Ejemplo n.º 2
0
 @Override
 public Incidence getNextIncidenceAtEdge() {
   if (getGraph().getTraversalContext() == null) {
     try {
       return localGraphDatabase.getIncidenceObject(
           storingGraphDatabase.getNextIncidenceIdAtEdgeId(id));
     } catch (RemoteException e) {
       throw new RuntimeException(e);
     }
   } else {
     return getNextIncidenceAtEdge(getGraph().getTraversalContext());
   }
 }
Ejemplo n.º 3
0
 @Override
 public final Incidence getNextIncidenceAtEdge(Graph traversalContext) {
   Incidence currentIncidence;
   try {
     currentIncidence =
         localGraphDatabase.getIncidenceObject(
             storingGraphDatabase.getNextIncidenceIdAtEdgeId(
                 storingGraphDatabase.getEdgeIdAtIncidenceId(id)));
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
   while ((traversalContext != null)
       && (currentIncidence != null)
       && (!traversalContext.containsVertex(currentIncidence.getVertex()))) {
     currentIncidence = currentIncidence.getNextIncidenceAtEdge();
   }
   return currentIncidence;
 }
Ejemplo n.º 4
0
 @Override
 public final Incidence getNextIncidenceAtEdge(Direction direction) {
   if (getGraph().getTraversalContext() == null) {
     Incidence i;
     try {
       i =
           localGraphDatabase.getIncidenceObject(
               storingGraphDatabase.getNextIncidenceIdAtEdgeId(id));
     } catch (RemoteException e) {
       throw new RuntimeException(e);
     }
     if ((direction != null) && (direction != Direction.BOTH)) {
       while ((i != null) && (direction != i.getDirection())) {
         i.getNextIncidenceAtEdge();
       }
     }
     return i;
   } else {
     return getNextIncidenceAtEdge(getGraph().getTraversalContext(), direction);
   }
 }