Class ParseUtils

java.lang.Object
org.locationtech.spatial4j.io.ParseUtils

@Deprecated public class ParseUtils extends Object
Deprecated.
Not useful; see https://github.com/spatial4j/spatial4j/issues/19
Utility methods related to parsing a series of numbers.

This code came from DistanceUtils, which came from Apache Lucene, LUCENE-773, which in turn came from "LocalLucene".

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final double[]
    parseLatitudeLongitude(double[] outLatLon, String latLonStr)
    Deprecated.
    A variation of parseLatitudeLongitude(String) that re-uses an output array.
    static final double[]
    Deprecated.
    Extract (by calling parsePoint(String[], String, int) and validate the latitude and longitude contained in the String by making sure the latitude is between 90 & -90 and longitude is between -180 and 180.
    static String[]
    parsePoint(String[] out, String externalVal, int dimension)
    Deprecated.
    Given a string containing dimension values encoded in it, separated by commas, return a String array of length dimension containing the values.
    static double[]
    parsePointDouble(double[] out, String externalVal, int dimension)
    Deprecated.
    Given a string containing dimension values encoded in it, separated by commas, return a double array of length dimension containing the values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParseUtils

      private ParseUtils()
      Deprecated.
  • Method Details

    • parsePoint

      public static String[] parsePoint(String[] out, String externalVal, int dimension) throws InvalidShapeException
      Deprecated.
      Given a string containing dimension values encoded in it, separated by commas, return a String array of length dimension containing the values.
      Parameters:
      out - A preallocated array. Must be size dimension. If it is not it will be resized.
      externalVal - The value to parse
      dimension - The expected number of values for the point
      Returns:
      An array of the values that make up the point (aka vector)
      Throws:
      InvalidShapeException - if the dimension specified does not match the number of values in the externalValue.
    • parsePointDouble

      public static double[] parsePointDouble(double[] out, String externalVal, int dimension) throws InvalidShapeException
      Deprecated.
      Given a string containing dimension values encoded in it, separated by commas, return a double array of length dimension containing the values.
      Parameters:
      out - A preallocated array. Must be size dimension. If it is not it will be resized.
      externalVal - The value to parse
      dimension - The expected number of values for the point
      Returns:
      An array of the values that make up the point (aka vector)
      Throws:
      InvalidShapeException - if the dimension specified does not match the number of values in the externalValue.
    • parseLatitudeLongitude

      public static final double[] parseLatitudeLongitude(String latLonStr) throws InvalidShapeException
      Deprecated.
      Extract (by calling parsePoint(String[], String, int) and validate the latitude and longitude contained in the String by making sure the latitude is between 90 & -90 and longitude is between -180 and 180.

      The latitude is assumed to be the first part of the string and the longitude the second part.

      Parameters:
      latLonStr - The string to parse. Latitude is the first value, longitude is the second.
      Returns:
      The lat long
      Throws:
      InvalidShapeException - if there was an error parsing
    • parseLatitudeLongitude

      public static final double[] parseLatitudeLongitude(double[] outLatLon, String latLonStr) throws InvalidShapeException
      Deprecated.
      A variation of parseLatitudeLongitude(String) that re-uses an output array.
      Throws:
      InvalidShapeException
      See Also: