@Test public void testGetOneLocationShort() throws Exception { List<String> list = new ArrayList<String>(); GetLocationResult result; list.clear(); list.add("bla"); result = service.getLocation(booischotShort, list); Assert.assertNull(result); list.clear(); list.add("Booischot"); result = service.getLocation(booischotShort, list); Assert.assertNotNull(result); list.clear(); list.add("booischot"); result = service.getLocation(booischotShort, list); Assert.assertNotNull(result); list.clear(); list.add("Booischot"); list.add("more"); result = service.getLocation(booischotShort, list); Assert.assertNull(result); list.clear(); list.add("xbooischot"); result = service.getLocation(booischotShort, list); Assert.assertNull(result); list.clear(); list.add("booischotx"); result = service.getLocation(booischotShort, list); Assert.assertNull(result); }
public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore) { GetLocationResult result = null; for (StaticRegexGeocoderLocationInfo test : geocoderInfo.getLocations()) { result = getLocation(test, location); if (null != result) { break; } } if (null != result) { return new GetLocationResult[]{result}; } return null; }
StaticRegexGeocoderService implements GeocoderService { public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore) { GetLocationResult result = null; for (StaticRegexGeocoderLocationInfo test : geocoderInfo.getLocations()) { result = getLocation(test, location); if (null != result) { break; } } if (null != result) { return new GetLocationResult[]{result}; } return null; } }
StaticRegexGeocoderService implements GeocoderService { public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore) { GetLocationResult result = null; for (StaticRegexGeocoderLocationInfo test : geocoderInfo.getLocations()) { result = getLocation(test, location); if (null != result) { break; } } if (null != result) { return new GetLocationResult[]{result}; } return null; }  }
StaticRegexGeocoderService implements GeocoderService { public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore) { GetLocationResult result = null; for (StaticRegexGeocoderLocationInfo test : geocoderInfo.getLocations()) { result = getLocation(test, location); if (null != result) { break; } } if (null != result) { return new GetLocationResult[]{result}; } return null; }  String getName(); @Api void setName(String name); @Api void setGeocoderInfo(StaticRegexGeocoderInfo geocoderInfo); CoordinateReferenceSystem getCrs(); GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore); }
StaticRegexGeocoderService implements GeocoderService { public GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore) { GetLocationResult result = null; for (StaticRegexGeocoderLocationInfo test : geocoderInfo.getLocations()) { result = getLocation(test, location); if (null != result) { break; } } if (null != result) { return new GetLocationResult[]{result}; } return null; }  String getName(); @Api void setName(String name); @Api void setGeocoderInfo(StaticRegexGeocoderInfo geocoderInfo); CoordinateReferenceSystem getCrs(); GetLocationResult[] getLocation(List<String> location, int maxAlternatives, Locale ignore);  }