Spring Data MongoDB - Core

org.springframework.data.mongodb.core.geo
Class Sphere

java.lang.Object
  extended by org.springframework.data.mongodb.core.geo.Sphere
All Implemented Interfaces:
Serializable, org.springframework.data.geo.Shape

public class Sphere
extends Object
implements Shape

Represents a geospatial sphere value.

Since:
1.5
Author:
Thomas Darimont
See Also:
Serialized Form

Field Summary
static String COMMAND
           
 
Constructor Summary
Sphere(org.springframework.data.geo.Circle circle)
          Creates a Sphere from the given Circle.
Sphere(Circle circle)
          Deprecated. 
Sphere(org.springframework.data.geo.Point center, org.springframework.data.geo.Distance radius)
          Creates a Sphere around the given center Point with the given radius.
Sphere(org.springframework.data.geo.Point center, double radius)
          Creates a Sphere around the given center Point with the given radius.
 
Method Summary
 List<? extends Object> asList()
          Returns the Shape as a list of usually Double or Lists of Doubles.
 boolean equals(Object obj)
           
 Point getCenter()
          Returns the center of the Circle.
 String getCommand()
          Returns the command to be used to create the $within criterion.
 org.springframework.data.geo.Distance getRadius()
          Returns the radius of the Circle.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMAND

public static final String COMMAND
See Also:
Constant Field Values
Constructor Detail

Sphere

public Sphere(org.springframework.data.geo.Point center,
              org.springframework.data.geo.Distance radius)
Creates a Sphere around the given center Point 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 center Point with the given radius.

Parameters:
center -
radius -

Sphere

public Sphere(org.springframework.data.geo.Circle circle)
Creates a Sphere from the given Circle.

Parameters:
circle -

Sphere

@Deprecated
public Sphere(Circle circle)
Deprecated. 

Creates a Sphere from the given Circle.

Parameters:
circle -
Method Detail

getCenter

public Point getCenter()
Returns the center of the Circle.

Returns:
will never be null.

getRadius

public org.springframework.data.geo.Distance getRadius()
Returns the radius of the Circle.

Returns:

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

asList

public List<? extends Object> asList()
Description copied from interface: Shape
Returns the Shape as a list of usually Double or Lists of Doubles. Wildcard bound to allow implementations to return a more concrete element type.

Returns:

getCommand

public String getCommand()
Description copied from interface: Shape
Returns the command to be used to create the $within criterion.

Returns:

Spring Data MongoDB - Core

Copyright © 2011-2014-2014 Pivotal Software, Inc.. All Rights Reserved.