Parses a point and check if it's wellformated

Syntax:

{ "type": "Point", "coordinates": [100.0, 0.0] }

@param jp
@throws IOException
975961
private void parsePointMetadata(JsonParser jp) throws IOException, SQLException {
        jp.nextToken(); // FIELD_NAME coordinates        
        String coordinatesField = jp.getText();
        if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
            jp.nextToken(); // START_ARRAY [ to parse the coordinate
            parseCoordinateMetadata(jp);            
        } else {
            throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'");
        }
    }
798143
private void parseClass()
    throws IOException
  {
    int magic = readInt();

    if (magic != JavaClass.MAGIC)
      throw error(L.l("bad magic number in class file"));

    int minor = readShort();
    int major = readShort();

    _class.setMajor(major);
    _class.setMinor(minor);

    parseConstantPool();

    int accessFlags = readShort();
    _class.setAccessFlags(accessFlags);

    int thisClassIndex = readShort();
    _class.setThisClass(_cp.getClass(thisClassIndex).getName());
    
    int superClassIndex = readShort();
    if (superClassIndex > 0)
      _class.setSuperClass(_cp.getClass(superClassIndex).getName());

    int interfaceCount = readShort();
    for (int i = 0; i < interfaceCount; i++) {
      int classIndex = readShort();

      _class.addInterface(_cp.getClass(classIndex).getName());
    }

    int fieldCount = readShort();
    for (int i = 0; i < fieldCount; i++) {
      parseField();
    }

    int methodCount = readShort();
    for (int i = 0; i < methodCount; i++)
      parseMethod();

    int attrCount = readShort();
    for (int i = 0; i < attrCount; i++) {
      Attribute attr = parseAttribute();

      _class.addAttribute(attr);
    }
  }
1144997
private void parseParentGeometryMetadata(JsonParser jp) throws IOException, SQLException {
        if(jp.nextToken()!=JsonToken.VALUE_NULL){//START_OBJECT { in case of null geometry
        jp.nextToken(); // FIELD_NAME type     
        jp.nextToken(); //VALUE_STRING Point
        String geometryType = jp.getText();        
        parseGeometryMetadata(jp, geometryType);
        } 
        
    }
1020372
private void readCoordinate() throws IOException {
        for( int i = 0; i < inputDimension; i++ ) {
            if (i <= 1) {
                ordValues[i] = precisionModel.makePrecise(dis.readDouble());
            } else {
                ordValues[i] = dis.readDouble();
            }

        }
    }
681107
private ArrayList<Object> parseArray(JsonParser jp) throws IOException {
        JsonToken value = jp.nextToken();
        ArrayList<Object> ret = new ArrayList<>();
        while(value != JsonToken.END_ARRAY) {
            if (value == JsonToken.START_OBJECT) {
                Object object = parseObject(jp);
                ret.add(object);
            } else if (value == JsonToken.START_ARRAY) {
                ArrayList<Object> arrayList = parseArray(jp);
                ret.add(arrayList.toArray());
            } else if (value == JsonToken.VALUE_NUMBER_INT) {
                ret.add(jp.getValueAsInt());
            } else if (value == JsonToken.VALUE_FALSE || value == JsonToken.VALUE_TRUE) {
                ret.add(jp.getValueAsBoolean());
            } else if (value == JsonToken.VALUE_NUMBER_FLOAT) {
                ret.add(jp.getValueAsDouble());
            } else if (value == JsonToken.VALUE_STRING) {
                ret.add(jp.getValueAsString());
            } else if (value == JsonToken.VALUE_NULL) {
                ret.add("null");
            }
            value = jp.nextToken();
        }
        return ret;
    }
1059293
public void pointTo(Object baseObject, long baseOffset, int sizeInBytes) {
    // Read the number of elements from the first 8 bytes.
    final long numElements = Platform.getLong(baseObject, baseOffset);
    assert numElements >= 0 : "numElements (" + numElements + ") should >= 0";
    assert numElements <= Integer.MAX_VALUE :
      "numElements (" + numElements + ") should <= Integer.MAX_VALUE";

    this.numElements = (int)numElements;
    this.baseObject = baseObject;
    this.baseOffset = baseOffset;
    this.sizeInBytes = sizeInBytes;
    this.elementOffset = baseOffset + calculateHeaderPortionInBytes(this.numElements);
  }
630552
@Override
    public SQLPPMapping parse(File file) throws InvalidMappingException, DuplicateMappingException, MappingIOException {
        checkFile(file);
        try (Reader reader = new FileReader(file)) {
            return load(reader, specificationFactory, ppMappingFactory, file.getName());
        } catch (IOException e) {
            throw new MappingIOException(e);
        }
    }
836145
protected <T> T parse(JsonReaderI<T> mapper) throws ParseException {
		this.pos = -1;
		T result;
		try {
			read();
			result = readFirst(mapper);
			if (checkTaillingData) {
				if (!checkTaillingSpace)
					skipSpace();
				if (c != EOI)
					throw new ParseException(pos - 1, ERROR_UNEXPECTED_TOKEN, c);
			}
		} catch (IOException e) {
			throw new ParseException(pos, e);
		}
		xs = null;
		xo = null;
		return result;
	}
364289
private void parseData() throws IOException, SQLException {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(fileName);
            try (JsonParser jp = jsFactory.createParser(fis)) {
                jp.nextToken();//START_OBJECT
                jp.nextToken(); // field_name (type)
                jp.nextToken(); // value_string (FeatureCollection)
                String geomType = jp.getText();
                if (geomType.equalsIgnoreCase(GeoJsonField.FEATURECOLLECTION)) {
                    parseFeatures(jp);
                } else {
                    throw new SQLException("Malformed GeoJSON file. Expected 'FeatureCollection', found '" + geomType + "'");
                }
            } //START_OBJECT
        } catch (FileNotFoundException ex) {
            throw new SQLException(ex);

        } finally {
            try {
                if (fis != null) {
                    fis.close();
                }
            } catch (IOException ex) {
                throw new SQLException(ex);
            }
        }
    }
1249831
public IGPSObject parse(final String line) throws ParseException {
		try {
			final JSONObject json = new JSONObject(line);
			return this.parse(json);
		} catch (final JSONException e) {
			throw new ParseException("Parsing failed", e);
		}
	}
223038
public static void readGeoJson(Connection connection, String fileName, String tableReference) throws IOException, SQLException {
        GeoJsonDriverFunction gjdf = new GeoJsonDriverFunction();
        gjdf.importFile(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressVisitor());
    }
47210
@Override
  public int compare(Point pointOne, Point pointTwo) {
    if (pointOne ==  null) {
      throw new JMetalException("PointOne is null") ;
    } else if (pointTwo == null) {
      throw new JMetalException("PointTwo is null");
    }

    // Determine the first i such as pointOne[i] != pointTwo[i];
    int index = 0;
    while ((index < pointOne.getDimension())
        && (index < pointTwo.getDimension())
        && pointOne.getValue(index) == pointTwo.getValue(index)) {
      index++;
    }

    int result = 0 ;
    if ((index >= pointOne.getDimension()) || (index >= pointTwo.getDimension())) {
      result = 0;
    } else if (pointOne.getValue(index) < pointTwo.getValue(index)) {
      result = -1;
    } else if (pointOne.getValue(index) > pointTwo.getValue(index)) {
      result = 1;
    }
    return result ;
  }
1176417
private MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, SQLException {
        jp.nextToken(); // FIELD_NAME coordinates        
        String coordinatesField = jp.getText();
        if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
            ArrayList<LineString> lineStrings = new ArrayList<LineString>();
            jp.nextToken();//START_ARRAY [ coordinates
            jp.nextToken(); // START_ARRAY [ coordinates line
            while (jp.getCurrentToken() != JsonToken.END_ARRAY) {
                lineStrings.add(GF.createLineString(parseCoordinates(jp)));
                jp.nextToken();
            }
            MultiLineString line = GF.createMultiLineString(lineStrings.toArray(new LineString[0]));
            jp.nextToken();//END_OBJECT } geometry
            return line;
        } else {
            throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'");
        }

    }
923380
private JsonParser parseResponse(Response response) throws IOException {
		InputStream is = response.getInputStream();
		Reader r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
		return new JsonParser(new JsonLexer(r));
	}
711936
public static void printJsonCodePoint(Appendable out, int codePoint)
        throws IOException
    {
        // JSON only allows double-quote strings.
        printCodePoint(out, codePoint, EscapeMode.JSON);
    }
1180365
public void pointTo(Object baseObject, long baseOffset, int sizeInBytes) {
    // Read the numBytes of key array from the first 8 bytes.
    final long keyArraySize = Platform.getLong(baseObject, baseOffset);
    assert keyArraySize >= 0 : "keyArraySize (" + keyArraySize + ") should >= 0";
    assert keyArraySize <= Integer.MAX_VALUE :
      "keyArraySize (" + keyArraySize + ") should <= Integer.MAX_VALUE";
    final int valueArraySize = sizeInBytes - (int)keyArraySize - 8;
    assert valueArraySize >= 0 : "valueArraySize (" + valueArraySize + ") should >= 0";

    keys.pointTo(baseObject, baseOffset + 8, (int)keyArraySize);
    values.pointTo(baseObject, baseOffset + 8 + keyArraySize, valueArraySize);

    assert keys.numElements() == values.numElements();

    this.baseObject = baseObject;
    this.baseOffset = baseOffset;
    this.sizeInBytes = sizeInBytes;
  }
1115074
private Point parsePoint(String point) {
    int comma = point.indexOf(',');
    if (comma == -1)
      return null;

    float lat = Float.valueOf(point.substring(0, comma));
    float lng = Float.valueOf(point.substring(comma + 1));
    return spatialctx.makePoint(lng, lat);
  }