addr.setAddressLine(0, route + " " + streetNumber);
gAddress.setAddressLine(addressIndex++, jResult.get("name").getAsString()); gAddress.setThoroughfare(jResult.get("name").getAsString()); displayName = jResult.get("name").getAsString(); gAddress.setAddressLine(addressIndex++, jResult.get("postcode").getAsString()); gAddress.setPostalCode(jResult.get("postcode").getAsString()); displayName += ", " + jResult.get("postcode").getAsString(); gAddress.setAddressLine(addressIndex++, jResult.get("city").getAsString()); gAddress.setLocality(jResult.get("city").getAsString()); displayName += ", " + jResult.get("city").getAsString(); gAddress.setAddressLine(addressIndex++, jResult.get("country").getAsString()); gAddress.setCountryName(jResult.get("country").getAsString()); displayName += ", " + jResult.get("country").getAsString();
gAddress.setAddressLine(addressIndex++, jAddress.get("road").getAsString()); gAddress.setThoroughfare(jAddress.get("road").getAsString()); gAddress.setAddressLine(addressIndex++, jAddress.get("postcode").getAsString()); gAddress.setPostalCode(jAddress.get("postcode").getAsString()); gAddress.setAddressLine(addressIndex++, jAddress.get("city").getAsString()); gAddress.setLocality(jAddress.get("city").getAsString()); } else if (jAddress.has("town")){ gAddress.setAddressLine(addressIndex++, jAddress.get("town").getAsString()); gAddress.setLocality(jAddress.get("town").getAsString()); } else if (jAddress.has("village")){ gAddress.setAddressLine(addressIndex++, jAddress.get("village").getAsString()); gAddress.setLocality(jAddress.get("village").getAsString()); gAddress.setAddressLine(addressIndex++, jAddress.get("country").getAsString()); gAddress.setCountryName(jAddress.get("country").getAsString());
address.setAddressLine(i, split[i]);
@Implementation public List<Address> getFromLocation(double latitude, double longitude, int maxResults) throws IOException { wasCalled = true; this.lastLatitude = latitude; this.lastLongitude = longitude; if (shouldSimulateGeocodeException) { throw new IOException("Simulated geocode exception"); } Address address = makeAddress(); address.setAddressLine(0, addressLine1); address.setLocality(city); address.setAdminArea(state); address.setPostalCode(zip); address.setCountryCode(countryCode); return Arrays.asList(address); }
@Implementation public List<Address> getFromLocation(double latitude, double longitude, int maxResults) throws IOException { wasCalled = true; this.lastLatitude = latitude; this.lastLongitude = longitude; if (shouldSimulateGeocodeException) { throw new IOException("Simulated geocode exception"); } Address address = makeAddress(); address.setAddressLine(0, addressLine1); address.setLocality(city); address.setAdminArea(state); address.setPostalCode(zip); address.setCountryCode(countryCode); return oneElementList(address); }
int numAddressLines = dis.readInt(); for (int i = 0; i < numAddressLines; ++i) { address.setAddressLine(i, readUTF(dis));
public CustomAddress(Address address) { super(address.getLocale()); for (int i = 0; i <= address.getMaxAddressLineIndex(); i++){ super.setAddressLine(i, address.getAddressLine(i)); } super.setFeatureName(address.getFeatureName()); super.setAdminArea(address.getAdminArea()); super.setSubAdminArea(address.getSubAdminArea()); super.setLocality(address.getLocality()); super.setSubLocality(address.getSubLocality()); super.setThoroughfare(address.getThoroughfare()); super.setSubThoroughfare(address.getSubThoroughfare()); super.setPostalCode(address.getPostalCode()); super.setCountryCode(address.getCountryCode()); super.setCountryName(address.getCountryName()); super.setLatitude(address.getLatitude()); super.setLongitude(address.getLongitude()); super.setPhone(address.getPhone()); super.setUrl(address.getUrl()); super.setExtras(address.getExtras()); }