01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, GeoTools Project Managment Committee (PMC)
05: * (C) 2001, Institut de Recherche pour le Développement
06: * (C) 1999, Fisheries and Oceans Canada
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Lesser General Public
10: * License as published by the Free Software Foundation;
11: * version 2.1 of the License.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Lesser General Public License for more details.
17: */
18: package org.geotools.measure;
19:
20: /**
21: * A longitude angle. Positive longitudes are East, while negative longitudes are West.
22: *
23: * @since 2.0
24: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/measure/Longitude.java $
25: * @version $Id: Longitude.java 20874 2006-08-07 10:00:01Z jgarnett $
26: * @author Martin Desruisseaux
27: *
28: * @see Latitude
29: * @see AngleFormat
30: */
31: public final class Longitude extends Angle {
32: /**
33: * Serial number for interoperability with different versions.
34: */
35: private static final long serialVersionUID = -8614900608052762636L;
36:
37: /**
38: * Minimum legal value for longitude (-180°).
39: */
40: public static final double MIN_VALUE = -180;
41:
42: /**
43: * Maximum legal value for longitude (+180°).
44: */
45: public static final double MAX_VALUE = +180;
46:
47: /**
48: * Contruct a new longitude with the specified value.
49: *
50: * @param theta Angle in degrees.
51: */
52: public Longitude(final double theta) {
53: super (theta);
54: }
55:
56: /**
57: * Constructs a newly allocated {@code Longitude} object that
58: * represents the longitude value represented by the string. The
59: * string should represents an angle in either fractional degrees
60: * (e.g. 45.5°) or degrees with minutes and seconds (e.g. 45°30').
61: * The hemisphere (E or W) is optional (default to East).
62: *
63: * @param theta A string to be converted to a {@code Longitude}.
64: * @throws NumberFormatException if the string does not contain a parsable longitude.
65: */
66: public Longitude(final String theta) throws NumberFormatException {
67: super(theta);
68: }
69: }
|