Example usage for org.json JSONArray optDouble

List of usage examples for org.json JSONArray optDouble

Introduction

In this page you can find the example usage for org.json JSONArray optDouble.

Prototype

public double optDouble(int index, double defaultValue) 

Source Link

Document

Get the optional double value associated with an index.

Usage

From source file:com.altamiracorp.lumify.twitter.TwitterGeoPointJsonProperty.java

@Override
protected GeoPoint fromJSON(final JSONArray jsonValue) {
    double latitude = jsonValue.optDouble(LATITUDE, NO_COORDINATE);
    double longitude = jsonValue.optDouble(LONGITUDE, NO_COORDINATE);
    return latitude != NO_COORDINATE && longitude != NO_COORDINATE ? new GeoPoint(latitude, longitude) : null;
}