Ejemplo n.º 1
0
  @Override
  public EdgeIteratorState getEdgeProps(int edgeId, int adjNode) {
    if (lg.isShortcut(edgeId))
      throw new IllegalStateException(
          "Do not fetch shortcuts from BaseGraph use the LevelGraph instead");

    return lg.getEdgeProps(edgeId, adjNode);
  }
Ejemplo n.º 2
0
  @Override
  public EdgeExplorer createEdgeExplorer(final EdgeFilter filter) {
    if (filter == EdgeFilter.ALL_EDGES) return createEdgeExplorer();

    return lg.createEdgeExplorer(
        new EdgeFilter() {
          @Override
          public boolean accept(EdgeIteratorState edgeIterState) {
            if (((EdgeSkipIterator) edgeIterState).isShortcut()) return false;

            return filter.accept(edgeIterState);
          }
        });
  }
Ejemplo n.º 3
0
  @Override
  public AllEdgesIterator getAllEdges() {
    final AllEdgesSkipIterator tmpIter = lg.getAllEdges();
    return new AllEdgesIterator() {
      @Override
      public int getCount() {
        return tmpIter.getCount();
      }

      @Override
      public boolean next() {
        while (tmpIter.next()) {
          if (!tmpIter.isShortcut()) {
            return true;
          }
        }
        return false;
      }

      @Override
      public int getEdge() {
        return tmpIter.getEdge();
      }

      @Override
      public int getBaseNode() {
        return tmpIter.getBaseNode();
      }

      @Override
      public int getAdjNode() {
        return tmpIter.getAdjNode();
      }

      @Override
      public PointList fetchWayGeometry(int type) {
        return tmpIter.fetchWayGeometry(type);
      }

      @Override
      public EdgeIteratorState setWayGeometry(PointList list) {
        return tmpIter.setWayGeometry(list);
      }

      @Override
      public double getDistance() {
        return tmpIter.getDistance();
      }

      @Override
      public EdgeIteratorState setDistance(double dist) {
        return tmpIter.setDistance(dist);
      }

      @Override
      public long getFlags() {
        return tmpIter.getFlags();
      }

      @Override
      public EdgeIteratorState setFlags(long flags) {
        return tmpIter.setFlags(flags);
      }

      @Override
      public String getName() {
        return tmpIter.getName();
      }

      @Override
      public EdgeIteratorState setName(String name) {
        return tmpIter.setName(name);
      }

      @Override
      public boolean getBoolean(int key, boolean reverse, boolean _default) {
        return tmpIter.getBoolean(key, reverse, _default);
      }

      @Override
      public int getAdditionalField() {
        return tmpIter.getAdditionalField();
      }

      @Override
      public EdgeIteratorState setAdditionalField(int value) {
        return tmpIter.setAdditionalField(value);
      }

      @Override
      public EdgeIteratorState copyPropertiesTo(EdgeIteratorState edge) {
        return tmpIter.copyPropertiesTo(edge);
      }

      @Override
      public EdgeIteratorState detach(boolean reverse) {
        return tmpIter.detach(reverse);
      }
    };
  }
Ejemplo n.º 4
0
 @Override
 public EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections) {
   return lg.edge(a, b, distance, bothDirections);
 }
Ejemplo n.º 5
0
 @Override
 public EdgeIteratorState edge(int a, int b) {
   return lg.edge(a, b);
 }
Ejemplo n.º 6
0
 @Override
 public BBox getBounds() {
   return lg.getBounds();
 }
Ejemplo n.º 7
0
 @Override
 public NodeAccess getNodeAccess() {
   return lg.getNodeAccess();
 }
Ejemplo n.º 8
0
 @Override
 public int getNodes() {
   return lg.getNodes();
 }
Ejemplo n.º 9
0
 @Override
 public GraphExtension getExtension() {
   return lg.getExtension();
 }
Ejemplo n.º 10
0
 @Override
 public EdgeExplorer createEdgeExplorer() {
   return lg.createEdgeExplorer(NO_SHORTCUTS);
 }