@Test public void TestAvoidNoBorders() { _searchParams.setAvoidBorders(BordersExtractor.Avoid.NONE); _searchParams.setAvoidCountries(new int[] {}); AvoidBordersEdgeFilter filter = new AvoidBordersEdgeFilter(_searchParams, _graphStorage); VirtualEdgeIteratorState ve1 = generateEdge(1); VirtualEdgeIteratorState ve2 = generateEdge(2); VirtualEdgeIteratorState ve3 = generateEdge(3); assertTrue(filter.accept(ve1)); assertTrue(filter.accept(ve2)); assertTrue(filter.accept(ve3)); }
@Override public final boolean accept(EdgeIteratorState iter) { if (!isStorageBuilt) return true; if (avoidBorders != BordersExtractor.Avoid.NONE) { switch(avoidBorders) { case ALL: if(bordersExtractor.isBorder(iter.getEdge())) { return false; } break; case CONTROLLED: if(bordersExtractor.isControlledBorder(iter.getEdge())) { return false; } break; default: break; } } return !avoidCountries || !bordersExtractor.restrictedCountry(iter.getEdge()); }
AvoidBordersEdgeFilter implements EdgeFilter { @Override public final boolean accept(EdgeIteratorState iter) { if (!isStorageBuilt) return true; if (avoidBorders != BordersExtractor.Avoid.NONE) { switch(avoidBorders) { case ALL: if(bordersExtractor.isBorder(iter.getEdge())) { return false; } break; case CONTROLLED: if(bordersExtractor.isControlledBorder(iter.getEdge())) { return false; } break; default: break; } } return !avoidCountries || !bordersExtractor.restrictedCountry(iter.getEdge()); } }
AvoidBordersEdgeFilter implements EdgeFilter { @Override public final boolean accept(EdgeIteratorState iter) { if (!isStorageBuilt) return true; if (avoidBorders != BordersExtractor.Avoid.NONE) { switch(avoidBorders) { case ALL: if(bordersExtractor.isBorder(iter.getEdge())) { return false; } break; case CONTROLLED: if(bordersExtractor.isControlledBorder(iter.getEdge())) { return false; } break; default: break; } } return !avoidCountries || !bordersExtractor.restrictedCountry(iter.getEdge()); } AvoidBordersEdgeFilter(RouteSearchParameters searchParams, BordersGraphStorage extBorders);  AvoidBordersEdgeFilter(RouteSearchParameters searchParams, GraphStorage graphStorage); }
AvoidBordersEdgeFilter implements EdgeFilter { @Override public final boolean accept(EdgeIteratorState iter) { if (!isStorageBuilt) return true; if (avoidBorders != BordersExtractor.Avoid.NONE) { switch(avoidBorders) { case ALL: if(bordersExtractor.isBorder(iter.getEdge())) { return false; } break; case CONTROLLED: if(bordersExtractor.isControlledBorder(iter.getEdge())) { return false; } break; default: break; } } return !avoidCountries || !bordersExtractor.restrictedCountry(iter.getEdge()); } AvoidBordersEdgeFilter(RouteSearchParameters searchParams, BordersGraphStorage extBorders);  AvoidBordersEdgeFilter(RouteSearchParameters searchParams, GraphStorage graphStorage); @Override final boolean accept(EdgeIteratorState iter); }
AvoidBordersEdgeFilter implements EdgeFilter { @Override public final boolean accept(EdgeIteratorState iter) { if (!isStorageBuilt) return true; if (avoidBorders != BordersExtractor.Avoid.NONE) { switch(avoidBorders) { case ALL: if(bordersExtractor.isBorder(iter.getEdge())) { return false; } break; case CONTROLLED: if(bordersExtractor.isControlledBorder(iter.getEdge())) { return false; } break; default: break; } } return !avoidCountries || !bordersExtractor.restrictedCountry(iter.getEdge()); } AvoidBordersEdgeFilter(RouteSearchParameters searchParams, BordersGraphStorage extBorders);  AvoidBordersEdgeFilter(RouteSearchParameters searchParams, GraphStorage graphStorage); @Override final boolean accept(EdgeIteratorState iter);  }