Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.factual.driver;
 
Represents a geographic sub query confining results to a circle.

Author(s):
aaron
public class Circle {
  private final double centerLat;
  private final double centerLong;
  private final int meters;


  
Constructs a geographic Circle representation.

Parameters:
centerLat the latitude of the center of this Circle.
centerLong the longitude of the center of this Circle.
meters the radius, in meters, of this Circle.
  public Circle(double centerLatdouble centerLongint meters) {
    this. = centerLat;
    this. = centerLong;
    this. = meters;
  }

  
View this circle as a json string representation

Returns:
a json string representation of this Circle
  public String toJsonStr() {
    return JsonUtil.toJsonStr(toJsonObject());
  }

  
View this Circle as an object representation that can be serialized as json

Returns:
an object representation of this circle that can be serialized as json
  @SuppressWarnings({ "unchecked""rawtypes""serial" })
  private Object toJsonObject() {
    return new HashMap() {
      {
        put(.new HashMap() {
          {
            put(.new double[]{});
            put(.);
          }
        });
      }
    };
  }
  public String toString() {
    return toJsonStr();
  }
New to GrepCode? Check out our FAQ X