Spring Data Document

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

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

public class Circle
extends Object
implements Shape

Represents a geospatial circle value

Author:
Mark Pollack, Oliver Gierke

Constructor Summary
Circle(double centerX, double centerY, double radius)
          Creates a new Circle from the given coordinates and radius.
Circle(Point center, double radius)
          Creates a new Circle from the given Point and radius.
 
Method Summary
 List<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.
 double 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
 

Constructor Detail

Circle

public Circle(Point center,
              double radius)
Creates a new Circle from the given Point and radius.

Parameters:
center - must not be null.
radius - must be greater or equal to zero.

Circle

public Circle(double centerX,
              double centerY,
              double radius)
Creates a new Circle from the given coordinates and radius.

Parameters:
centerX -
centerY -
radius - must be greater or equal to zero.
Method Detail

getCenter

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

Returns:
will never be null.

getRadius

public double getRadius()
Returns the radius of the Circle.

Returns:

asList

public List<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.

Specified by:
asList in interface Shape
Returns:

getCommand

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

Specified by:
getCommand in interface Shape
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

Spring Data Document

Copyright © 2012. All Rights Reserved.