01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.referencing.factory.epsg;
17:
18: // Geotools dependencies
19: import org.geotools.resources.Utilities;
20:
21: /**
22: * A (name, description) pair for a coordinate system axis.
23: *
24: * @since 2.3
25: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/AxisName.java $
26: * @version $Id: AxisName.java 20874 2006-08-07 10:00:01Z jgarnett $
27: * @author Martin Desruisseaux
28: */
29: final class AxisName {
30: /**
31: * The coordinate system axis name (never {@code null}).
32: */
33: public final String name;
34:
35: /**
36: * The coordinate system axis description, or {@code null} if none.
37: */
38: public final String description;
39:
40: /**
41: * Creates a new coordinate system axis name.
42: */
43: public AxisName(final String name, final String description) {
44: this .name = name;
45: this .description = description;
46: }
47:
48: /**
49: * Returns a hash code for this object.
50: */
51: public int hashCode() {
52: return name.hashCode();
53: }
54:
55: /**
56: * Compare this name with the specified object for equality.
57: */
58: public boolean equals(final Object object) {
59: if (object instanceof AxisName) {
60: final AxisName that = (AxisName) object;
61: return Utilities.equals(this .name, that.name)
62: && Utilities.equals(this .description,
63: that.description);
64: }
65: return false;
66: }
67:
68: /**
69: * Returns a string representation of this object, for debugging purpose only.
70: */
71: public String toString() {
72: return name;
73: }
74: }
|