src/org/ohmage/util/StringUtils.java
public static Double decodeLongitude(String longitude) {
		if(StringUtils.isEmptyOrWhitespaceOnly(longitude)) {
			return null;
		}
		
		try {
			Double longitudeDouble = Double.parseDouble(longitude);
			if((longitudeDouble < -LONGITUDE_LIMIT) || (longitudeDouble > LONGITUDE_LIMIT)) {
				return null;
			}
			else {
				return longitudeDouble;
			}
		}
		catch(NumberFormatException e) {
			return null;
		}
	}
/**
	 * Decodes a String into a Double and then verifies that it is a plausible
	 * longitude value. If the String is null, whitespace only, or not a
	 * plausible longitude value, null is returned; otherwise a Double 
	 * representing the longitude value is returned.
	 * 
	 * @param longitude The String to be decoded.
	 * 
	 * @return Null if the String is null, whitespace only, not a number, or
	 * 		   not a valid longitude value.
	 */
Decodes a String into a Double and then verifies that it is a plausible
longitude value. If the String is null, whitespace only, or not a
plausible longitude value, null is returned; otherwise a Double
representing the longitude value is returned.

@param longitude The String to be decoded.

@return Null if the String is null, whitespace only, not a number, or
not a valid longitude value.
Decodes a String into a Double and then verifies that it is a plausible longitude value . If the String is null whitespace only or not a plausible longitude value null is returned ; otherwise a Double representing the longitude value is returned . @param longitude The String to be decoded . @return Null if the String is null whitespace only not a number or not a valid longitude value .
public static Double decodeLongitude(String longitude) {
		if(StringUtils.isEmptyOrWhitespaceOnly(longitude)) {
			return null;
		}
		try {
			Double longitudeDouble = Double.parseDouble(longitude);
			if((longitudeDouble < -LONGITUDE_LIMIT) || (longitudeDouble > LONGITUDE_LIMIT)) {
				return null;
			}
			else {
				return longitudeDouble;
			}
		}
		catch(NumberFormatException e) {
			return null;
		}
	}
public static Double decodeLongitude ( String longitude ) { if ( StringUtils . isEmptyOrWhitespaceOnly ( longitude ) ) { return null ; } try { Double longitudeDouble = Double . parseDouble ( longitude ) ; if ( ( longitudeDouble < - LONGITUDE_LIMIT ) || ( longitudeDouble > LONGITUDE_LIMIT ) ) { return null ; } else { return longitudeDouble ; } } catch ( NumberFormatException e ) { return null ; } }
Decodes a String into a Double and then verifies that it is a plausible
 longitude value.
Decodes a String into a Double and then verifies that it is a plausible longitude value .