@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GeocoderGeometry that = (GeocoderGeometry) o; if (location != null ? !location.equals(that.location) : that.location != null) return false; if (locationType != that.locationType) return false; if (viewport != null ? !viewport.equals(that.viewport) : that.viewport != null) return false; if (bounds != null ? !bounds.equals(that.bounds) : that.bounds != null) return false; return true; }
/** * @param precision * @return Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. */ public String toUrlValue(int precision) { return getSouthwest().toUrlValue(precision) + "," + getNortheast().toUrlValue(precision); }
@Override public int hashCode() { int result = location != null ? location.hashCode() : 0; result = 31 * result + (locationType != null ? locationType.hashCode() : 0); result = 31 * result + (viewport != null ? viewport.hashCode() : 0); result = 31 * result + (bounds != null ? bounds.hashCode() : 0); return result; }
@Override protected Void doInBackground(Void... voids) { try { GraphMetadata metadata = CalculItineraires.getInstance().getMetadata(); if (metadata != null) { setBounds(new LatLngBounds(new LatLng(new BigDecimal(metadata.getMinLatitude()), new BigDecimal(metadata.getMinLongitude())), new LatLng(new BigDecimal( metadata.getMaxLatitude()), new BigDecimal(metadata.getMaxLongitude())))); } } catch (OpenTripPlannerException ignore) { } return null; } }.execute((Void) null);
/** * @return Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. */ public String toUrlValue() { return toUrlValue(LatLng.DEFAULT_PRECISION); }
setBounds(new LatLngBounds(new LatLng(new BigDecimal(boundsBdd.getMinLatitude()), new BigDecimal(boundsBdd.getMinLongitude())), new LatLng(new BigDecimal( boundsBdd.getMaxLatitude()), new BigDecimal(boundsBdd.getMaxLongitude()))));
url.append("&bounds=").append(URLEncoder.encode(bounds.getSouthwest().toUrlValue() + "|" + bounds.getNortheast().toUrlValue(), ENCODING));
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GeocoderRequest that = (GeocoderRequest) o; if (address != null ? !address.equals(that.address) : that.address != null) return false; if (bounds != null ? !bounds.equals(that.bounds) : that.bounds != null) return false; if (channel != null ? !channel.equals(that.channel) : that.channel != null) return false; if (components != null ? !components.equals(that.components) : that.components != null) return false; if (language != null ? !language.equals(that.language) : that.language != null) return false; if (location != null ? !location.equals(that.location) : that.location != null) return false; if (region != null ? !region.equals(that.region) : that.region != null) return false; return true; }
@Override public int hashCode() { int result = channel != null ? channel.hashCode() : 0; result = 31 * result + (address != null ? address.hashCode() : 0); result = 31 * result + (language != null ? language.hashCode() : 0); result = 31 * result + (region != null ? region.hashCode() : 0); result = 31 * result + (bounds != null ? bounds.hashCode() : 0); result = 31 * result + (location != null ? location.hashCode() : 0); result = 31 * result + (components != null ? components.hashCode() : 0); return result; }