/** * Overrides base implementation by validating that the string represents * a latitude coordinate between -90 and 90 degrees. Also formats the * the string so that it has a consistent number of significant digits * after the decimal point. */ @Override public void setValue(String value) { Double d = null; if (value != null) { // First ensure that the string is actually a double. try { d = Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException("'value' must be a double."); } } setLatitude(d); } }
/** * Overrides base implementation by validating that the string represents * a latitude coordinate between -90 and 90 degrees. Also formats the * the string so that it has a consistent number of significant digits * after the decimal point. */ @Override public void setValue(String value) { Double d = null; if (value != null) { // First ensure that the string is actually a double. try { d = Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException("'value' must be a double."); } } setLatitude(d); } }
/** * Overrides base implementation by validating that the string represents * a latitude coordinate between -90 and 90 degrees. Also formats the * the string so that it has a consistent number of significant digits * after the decimal point. */ @Override public void setValue(String value) { Double d = null; if (value != null) { // First ensure that the string is actually a double. try { d = Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException("'value' must be a double."); } } setLatitude(d); } }
/** * Creates an immutable instance of GeoLat extension with the coordinate * set to the value passed in. * * @param lat The latitude coordinate reprensented by this element. * @throws IllegalArgumentException if the the latitude is not between * -90 and 90. */ public GeoLat(Double lat) throws IllegalArgumentException { super(Namespaces.W3C_GEO_NAMESPACE, "lat", null, null); setRequired(true); if (lat != null) { setLatitude(lat); setImmutable(true); } }
/** * Creates an immutable instance of GeoLat extension with the coordinate * set to the value passed in. * * @param lat The latitude coordinate reprensented by this element. * @throws IllegalArgumentException if the the latitude is not between * -90 and 90. */ public GeoLat(Double lat) throws IllegalArgumentException { super(Namespaces.W3C_GEO_NAMESPACE, "lat", null, null); setRequired(true); if (lat != null) { setLatitude(lat); setImmutable(true); } }
/** * Creates an immutable instance of GeoLat extension with the coordinate * set to the value passed in. * * @param lat The latitude coordinate reprensented by this element. * @throws IllegalArgumentException if the the latitude is not between * -90 and 90. */ public GeoLat(Double lat) throws IllegalArgumentException { super(Namespaces.W3C_GEO_NAMESPACE, "lat", null, null); setRequired(true); if (lat != null) { setLatitude(lat); setImmutable(true); } }