Package com.parse
Class ParsePolygon
- java.lang.Object
-
- com.parse.ParsePolygon
-
public class ParsePolygon extends java.lang.Object
ParsePolygon
represents a set of coordinates that may be associated with a key in aParseObject
or used as a reference point for geo queries. This allows proximity based queries on the key.Example:
List
points = 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();
-
-
Field Summary
Fields Modifier and Type Field Description static <any>
CREATOR
-
Constructor Summary
Constructors Constructor Description ParsePolygon(ParsePolygon polygon)
Creates a copy ofpolygon
;ParsePolygon(java.util.List<ParseGeoPoint> coords)
Creates a new polygon with the specifiedParseGeoPoint
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsPoint(ParseGeoPoint point)
Checks if thisParsePolygon
; containsParseGeoPoint
.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(Parcel dest, int flags)
-
-
-
Constructor Detail
-
ParsePolygon
public ParsePolygon(java.util.List<ParseGeoPoint> coords)
Creates a new polygon with the specifiedParseGeoPoint
.- Parameters:
coords
- The polygon's coordinates.
-
ParsePolygon
public ParsePolygon(ParsePolygon polygon)
Creates a copy ofpolygon
;- Parameters:
polygon
- The polygon to copy.
-
-
Method Detail
-
getCoordinates
public java.util.List<ParseGeoPoint> getCoordinates()
Get coordinates.
-
setCoordinates
public void setCoordinates(java.util.List<ParseGeoPoint> coords)
Set coordinates. Valid are Array of GeoPoint, ParseGeoPoint or Location at least 3 points- Parameters:
coords
- The polygon's coordinates.
-
containsPoint
public boolean containsPoint(ParseGeoPoint point)
Checks if thisParsePolygon
; containsParseGeoPoint
.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
describeContents
public int describeContents()
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
-
-