Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.factual.driver;
General representation of a Shape, for the purpose of geo filters.

public abstract class Shape {

The driver relies on calling toString() to get the representation of Shapes.
  public String toString() {
    return toJsonStr();


the full JSON representation of this Shape.
  private String toJsonStr() {
    return JsonUtil.toJsonStr(withinStruct());

Can be used by Shape implementations to get the full 'within' structure for a query.

the 'within' structure for a query.
  @SuppressWarnings({ "unchecked""rawtypes""serial" })
  private Object withinStruct() {
    return new HashMap(){{

All Shapes must implement this to return a structure that represents the shape with data that can be JSON-ized.

a structure that represents the shape
  public abstract Object toJsonObject();
New to GrepCode? Check out our FAQ X