Class ParseUtils


  • @Deprecated
    public class ParseUtils
    extends java.lang.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 ParseUtils()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static double[] parseLatitudeLongitude​(double[] outLatLon, java.lang.String latLonStr)
      Deprecated.
      A variation of parseLatitudeLongitude(String) that re-uses an output array.
      static double[] parseLatitudeLongitude​(java.lang.String latLonStr)
      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 java.lang.String[] parsePoint​(java.lang.String[] out, java.lang.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, java.lang.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 Detail

      • ParseUtils

        private ParseUtils()
        Deprecated.
    • Method Detail

      • parsePoint

        public static java.lang.String[] parsePoint​(java.lang.String[] out,
                                                    java.lang.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,
                                                java.lang.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​(java.lang.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