org.apache.blur.analysis.type.spatial
Class ShapeReadWriter<CTX extends com.spatial4j.core.context.SpatialContext>

java.lang.Object
  extended by org.apache.blur.analysis.type.spatial.ShapeReadWriter<CTX>

public class ShapeReadWriter<CTX extends com.spatial4j.core.context.SpatialContext>
extends Object

Reads and writes Shapes to strings.


Constructor Summary
ShapeReadWriter(com.spatial4j.core.context.SpatialContext ctx)
           
 
Method Summary
static NumberFormat makeNumberFormat(int fractionDigits)
          A convenience method to create a suitable NumberFormat for writing numbers.
 com.spatial4j.core.shape.Shape readShape(String value)
          Reads a shape from a given string (ie, X Y, XMin XMax...
 String writeShape(com.spatial4j.core.shape.Shape shape)
          Writes a shape to a String, in a format that can be read by readShape(String).
 String writeShape(com.spatial4j.core.shape.Shape shape, NumberFormat nf)
          Overloaded to provide a number format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeReadWriter

public ShapeReadWriter(com.spatial4j.core.context.SpatialContext ctx)
Method Detail

readShape

public com.spatial4j.core.shape.Shape readShape(String value)
                                         throws com.spatial4j.core.exception.InvalidShapeException
Reads a shape from a given string (ie, X Y, XMin XMax... WKT)

Parameters:
value - A string representation of the shape; not null.
Returns:
A Shape; not null.
Throws:
com.spatial4j.core.exception.InvalidShapeException
See Also:
writeShape(com.spatial4j.core.shape.Shape)

writeShape

public String writeShape(com.spatial4j.core.shape.Shape shape)
Writes a shape to a String, in a format that can be read by readShape(String).

Parameters:
shape - Not null.
Returns:
Not null.

writeShape

public String writeShape(com.spatial4j.core.shape.Shape shape,
                         NumberFormat nf)
Overloaded to provide a number format.


makeNumberFormat

public static NumberFormat makeNumberFormat(int fractionDigits)
A convenience method to create a suitable NumberFormat for writing numbers.



Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.