public class ParsePolygon
extends java.lang.Object
implements android.os.Parcelable
ParsePolygon represents a set of coordinates that may be associated with a key
in a ParseObject or used as a reference point for geo queries. This allows proximity
based queries on the key.
Example:
Listpoints = new ArrayList (); points.add(new ParseGeoPoint(0,0)); points.add(new ParseGeoPoint(0,1)); points.add(new ParseGeoPoint(1,1)); points.add(new ParseGeoPoint(1,0)); ParsePolygon polygon = new ParsePolygon(points); ParseObject object = new ParseObject("PlaceObject"); object.put("area", polygon); object.save();
| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<ParsePolygon> |
CREATOR |
| Modifier | Constructor and Description |
|---|---|
|
ParsePolygon(java.util.List<ParseGeoPoint> coords)
Creates a new polygon with the specified
ParseGeoPoint. |
protected |
ParsePolygon(android.os.Parcel source)
Creates a new point instance from a
Parcel source. |
|
ParsePolygon(ParsePolygon polygon)
Creates a copy of
polygon; |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsPoint(ParseGeoPoint point)
Checks if this
ParsePolygon; contains ParseGeoPoint. |
protected org.json.JSONArray |
coordinatesToJSONArray()
Get converts coordinate to JSONArray.
|
int |
describeContents() |
boolean |
equals(java.lang.Object obj) |
java.util.List<ParseGeoPoint> |
getCoordinates()
Get coordinates.
|
void |
setCoordinates(java.util.List<ParseGeoPoint> coords)
Set coordinates.
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<ParsePolygon> CREATOR
public ParsePolygon(java.util.List<ParseGeoPoint> coords)
ParseGeoPoint.coords - The polygon's coordinates.public ParsePolygon(ParsePolygon polygon)
polygon;polygon - The polygon to copy.protected ParsePolygon(android.os.Parcel source)
Parcel source. This is used when unparceling a
ParsePolygon. Subclasses that need Parcelable behavior should provide their own
Parcelable.Creator and override this constructor.source - The recovered parcel.public java.util.List<ParseGeoPoint> getCoordinates()
public void setCoordinates(java.util.List<ParseGeoPoint> coords)
coords - The polygon's coordinates.protected org.json.JSONArray coordinatesToJSONArray()
throws org.json.JSONException
org.json.JSONExceptionpublic boolean containsPoint(ParseGeoPoint point)
ParsePolygon; contains ParseGeoPoint.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelable