diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java index c5b8ad3077..c09c00fced 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java @@ -37,6 +37,11 @@ public class VisibleRegion implements Parcelable { */ public final LatLngBounds latLngBounds; + /** + * Creates a VisibleRegion from a Parcel. + * + * @param in The Parcel to create this from + */ private VisibleRegion(Parcel in) { this.farLeft = in.readParcelable(LatLng.class.getClassLoader()); this.farRight = in.readParcelable(LatLng.class.getClassLoader()); @@ -46,7 +51,7 @@ public class VisibleRegion implements Parcelable { } /** - * Creates a new VisibleRegion given the four corners of the camera. + * Creates a VisibleRegion given the four corners of the camera. * * @param farLeft A LatLng object containing the latitude and longitude of the near left corner of the region. * @param farRight A LatLng object containing the latitude and longitude of the near left corner of the region. @@ -88,12 +93,22 @@ public class VisibleRegion implements Parcelable { && latLngBounds.equals(visibleRegion.latLngBounds); } + /** + * The string representation of the object. + * + * @return the string representation of this + */ @Override public String toString() { return "[farLeft [" + farLeft + "], farRight [" + farRight + "], nearLeft [" + nearLeft + "], nearRight [" + nearRight + "], latLngBounds [" + latLngBounds + "]]"; } + /** + * Returns a hash code value for the object. + * + * @return the hash code + */ @Override public int hashCode() { return ((farLeft.hashCode() + 90) @@ -102,11 +117,22 @@ public class VisibleRegion implements Parcelable { + ((nearRight.hashCode() + 180) * 1000000000)); } + /** + * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. + * + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written + */ @Override public void writeToParcel(Parcel out, int flags) { out.writeParcelable(farLeft, flags); @@ -116,6 +142,9 @@ public class VisibleRegion implements Parcelable { out.writeParcelable(latLngBounds, flags); } + /** + * Inner class responsible for recreating Parcels into objects. + */ public static final Parcelable.Creator<VisibleRegion> CREATOR = new Parcelable.Creator<VisibleRegion>() { public VisibleRegion createFromParcel(Parcel in) { |