/** * Overrides base implementation by validating that the string represents * a longitude coordinate between -180 and 180 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."); } } setLongitude(d); } }
/** * Overrides base implementation by validating that the string represents * a longitude coordinate between -180 and 180 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."); } } setLongitude(d); } }
/** * Overrides base implementation by validating that the string represents * a longitude coordinate between -180 and 180 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."); } } setLongitude(d); } }
/** * Creates an immutable instance of GeoLong extension with the coordinate * set to the value passed in. * * @param lon The longitude coordinate reprensented by this element. * @throws IllegalArgumentException if the longitude is not between * -180 and 180 degrees. */ public GeoLong(Double lon) throws IllegalArgumentException { super(Namespaces.W3C_GEO_NAMESPACE, "long", null, null); setRequired(true); if (lon != null) { setLongitude(lon); setImmutable(true); } }
/** * Creates an immutable instance of GeoLong extension with the coordinate * set to the value passed in. * * @param lon The longitude coordinate reprensented by this element. * @throws IllegalArgumentException if the longitude is not between * -180 and 180 degrees. */ public GeoLong(Double lon) throws IllegalArgumentException { super(Namespaces.W3C_GEO_NAMESPACE, "long", null, null); setRequired(true); if (lon != null) { setLongitude(lon); setImmutable(true); } }
/** * Creates an immutable instance of GeoLong extension with the coordinate * set to the value passed in. * * @param lon The longitude coordinate reprensented by this element. * @throws IllegalArgumentException if the longitude is not between * -180 and 180 degrees. */ public GeoLong(Double lon) throws IllegalArgumentException { super(Namespaces.W3C_GEO_NAMESPACE, "long", null, null); setRequired(true); if (lon != null) { setLongitude(lon); setImmutable(true); } }