private static Double readLongitude(Object o) {
        if (o == null) {
            return null;
        }
        Double value;
        if (o instanceof Number) {
            value = ((Number) o).doubleValue();
        } else {
            try {
                value = Double.valueOf(o.toString());
            } catch (NumberFormatException e) {
                throw new IndexException("Unparseable longitude: {}", o);
            }
        }
        return GeospatialUtils.checkLongitude("longitude", value);
    }
private static Double readLongitude ( Object o ) { if ( o == null ) { return null ; } Double value ; if ( o instanceof Number ) { value = ( ( Number ) o ) . doubleValue ( ) ; } else { try { value = Double . valueOf ( o . toString ( ) ) ; } catch ( NumberFormatException e ) { throw new IndexException ( "Unparseable longitude: {}" , o ) ; } } return GeospatialUtils . checkLongitude ( "longitude" , value ) ; }
Returns the longitude contained in the specified {@link Object}.

A valid longitude must in the range [-180, 180].

@param o the {@link Object} containing the latitude
@return the longitude