Class Sphere
java.lang.Object
org.springframework.data.mongodb.core.geo.Sphere
- All Implemented Interfaces:
Serializable
,org.springframework.data.geo.Shape
Represents a geospatial sphere value.
- Since:
- 1.5
- Author:
- Thomas Darimont, Mark Paluch
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSphere
(org.springframework.data.geo.Circle circle) Creates a Sphere from the givenCircle
.Sphere
(org.springframework.data.geo.Point center, double radius) Creates a Sphere around the given centerPoint
with the given radius.Sphere
(org.springframework.data.geo.Point center, org.springframework.data.geo.Distance radius) Creates a Sphere around the given centerPoint
with the given radius. -
Method Summary
-
Field Details
-
COMMAND
- See Also:
-
-
Constructor Details
-
Sphere
public Sphere(org.springframework.data.geo.Point center, org.springframework.data.geo.Distance radius) Creates a Sphere around the given centerPoint
with the given radius.- Parameters:
center
- must not be null.radius
- must not be null.
-
Sphere
public Sphere(org.springframework.data.geo.Point center, double radius) Creates a Sphere around the given centerPoint
with the given radius.- Parameters:
center
- must not be null.radius
-
-
Sphere
public Sphere(org.springframework.data.geo.Circle circle) Creates a Sphere from the givenCircle
.- Parameters:
circle
- must not be null.
-
-
Method Details
-
getCenter
public org.springframework.data.geo.Point getCenter()Returns the center of theCircle
.- Returns:
- will never be null.
-
getRadius
public org.springframework.data.geo.Distance getRadius()Returns the radius of theCircle
.- Returns:
- never null.
-
toString
-
equals
-
hashCode
public int hashCode() -
asList
Returns theShape
as a list of usuallyDouble
orList
s ofDouble
s. Wildcard bound to allow implementations to return a more concrete element type.- Returns:
- never null.
-
getCommand
Returns the command to be used to create the $within criterion.- Returns:
- never null.
-