001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/model/coverage/SampleDimensionType.java $
002 /*----------------------------------------------------------------------------
003 This file originated as a part of GeoAPI.
004
005 GeoAPI is free software. GeoAPI may be used, modified and
006 redistributed by anyone for any purpose requring only maintaining the
007 copyright and license terms on the source code and derivative files.
008 See the OGC legal page for details.
009
010 The copyright to the GeoAPI interfaces is held by the Open Geospatial
011 Consortium, see http://www.opengeospatial.org/ogc/legal
012 ----------------------------------------------------------------------------*/
013 package org.deegree.model.coverage;
014
015 /**
016 * Specifies the various dimension types for coverage values. For grid coverages, these correspond
017 * to band types.
018 *
019 * @UML codelist CV_SampleDimensionType
020 * @author <A HREF="http://www.opengis.org">OpenGIS® consortium</A>
021 * @version <A HREF="http://www.opengis.org/docs/01-004.pdf">Grid Coverage specification 1.0</A>
022 *
023 * @see SampleDimension
024 */
025 public final class SampleDimensionType extends CodeList {
026 /**
027 * Serial number for compatibility with different versions.
028 */
029 private static final long serialVersionUID = -4153433145134818506L;
030
031 /**
032 * Unsigned 1 bit integers.
033 *
034 * @UML conditional CV_1BIT
035 * @rename Renamed <code>CV_1BIT</code> as <code>UNSIGNED_1BIT</code> since we drop the
036 * prefix, but can't get a name starting with a digit.
037 */
038 public static final SampleDimensionType UNSIGNED_1BIT = new SampleDimensionType( "UNSIGNED_1BIT", 0 );
039
040 /**
041 * Unsigned 2 bits integers.
042 *
043 * @UML conditional CV_2BIT
044 * @rename Renamed <code>CV_2BIT</code> as <code>UNSIGNED_2BITS</code> since we drop the
045 * prefix, but can't get a name starting with a digit.
046 */
047 public static final SampleDimensionType UNSIGNED_2BITS = new SampleDimensionType( "UNSIGNED_2BITS", 1 );
048
049 /**
050 * Unsigned 4 bits integers.
051 *
052 * @UML conditional CV_4BIT
053 * @rename Renamed <code>CV_4BIT</code> as <code>UNSIGNED_4BITS</code> since we drop the
054 * prefix, but can't get a name starting with a digit.
055 */
056 public static final SampleDimensionType UNSIGNED_4BITS = new SampleDimensionType( "UNSIGNED_4BITS", 2 );
057
058 /**
059 * Unsigned 8 bits integers.
060 *
061 * @UML conditional CV_8BIT_U
062 * @rename Renamed <code>CV_8BIT_U</code> as <code>UNSIGNED_8BITS</code> since we drop the
063 * prefix, but can't get a name starting with a digit.
064 *
065 * @see #SIGNED_8BITS
066 * @see java.awt.image.DataBuffer#TYPE_BYTE
067 */
068 public static final SampleDimensionType UNSIGNED_8BITS = new SampleDimensionType( "UNSIGNED_8BITS", 3 );
069
070 /**
071 * Signed 8 bits integers.
072 *
073 * @UML conditional CV_8BIT_S
074 * @rename Renamed <code>CV_8BIT_S</code> as <code>SIGNED_8BITS</code> since we drop the
075 * prefix, but can't get a name starting with a digit.
076 *
077 * @see #UNSIGNED_8BITS
078 */
079 public static final SampleDimensionType SIGNED_8BITS = new SampleDimensionType( "SIGNED_8BITS", 4 );
080
081 /**
082 * Unsigned 16 bits integers.
083 *
084 * @UML conditional CV_16BIT_U
085 * @rename Renamed <code>CV_16BIT_U</code> as <code>UNSIGNED_16BITS</code> since we drop the
086 * prefix, but can't get a name starting with a digit.
087 *
088 * @see #SIGNED_16BITS
089 * @see java.awt.image.DataBuffer#TYPE_USHORT
090 */
091 public static final SampleDimensionType UNSIGNED_16BITS = new SampleDimensionType( "UNSIGNED_16BITS", 5 );
092
093 /**
094 * Signed 16 bits integers.
095 *
096 * @UML conditional CV_16BIT_S
097 * @rename Renamed <code>CV_16BIT_S</code> as <code>SIGNED_16BITS</code> since we drop the
098 * prefix, but can't get a name starting with a digit.
099 *
100 * @see #UNSIGNED_16BITS
101 * @see java.awt.image.DataBuffer#TYPE_SHORT
102 */
103 public static final SampleDimensionType SIGNED_16BITS = new SampleDimensionType( "SIGNED_16BITS", 6 );
104
105 /**
106 * Unsigned 32 bits integers.
107 *
108 * @UML conditional CV_32BIT_U
109 * @rename Renamed <code>CV_32BIT_U</code> as <code>UNSIGNED_32BITS</code> since we drop the
110 * prefix, but can't get a name starting with a digit.
111 *
112 * @see #SIGNED_32BITS
113 */
114 public static final SampleDimensionType UNSIGNED_32BITS = new SampleDimensionType( "UNSIGNED_32BITS", 7 );
115
116 /**
117 * Signed 32 bits integers.
118 *
119 * @UML conditional CV_32BIT_S
120 * @rename Renamed <code>CV_32BIT_S</code> as <code>SIGNED_32BITS</code> since we drop the
121 * prefix, but can't get a name starting with a digit.
122 *
123 * @see #UNSIGNED_32BITS
124 * @see java.awt.image.DataBuffer#TYPE_INT
125 */
126 public static final SampleDimensionType SIGNED_32BITS = new SampleDimensionType( "SIGNED_32BITS", 8 );
127
128 /**
129 * Simple precision floating point numbers.
130 *
131 * @UML conditional CV_32BIT_REAL
132 * @rename Renamed <code>CV_32BIT_REAL</code> as <code>REAL_32BITS</code> since we drop the
133 * prefix, but can't get a name starting with a digit.
134 *
135 * @see #REAL_64BITS
136 * @see java.awt.image.DataBuffer#TYPE_FLOAT
137 */
138 public static final SampleDimensionType REAL_32BITS = new SampleDimensionType( "REAL_32BITS", 9 );
139
140 /**
141 * Double precision floating point numbers.
142 *
143 * @UML conditional CV_64BIT_REAL
144 * @rename Renamed <code>CV_64BIT_REAL</code> as <code>REAL_64BITS</code> since we drop the
145 * prefix, but can't get a name starting with a digit.
146 *
147 * @see #REAL_32BITS
148 * @see java.awt.image.DataBuffer#TYPE_DOUBLE
149 */
150 public static final SampleDimensionType REAL_64BITS = new SampleDimensionType( "REAL_64BITS", 10 );
151
152 /**
153 * List of all enumerations of this type.
154 */
155 private static final SampleDimensionType[] VALUES = new SampleDimensionType[] { UNSIGNED_1BIT, UNSIGNED_2BITS,
156 UNSIGNED_4BITS, UNSIGNED_8BITS,
157 SIGNED_8BITS, UNSIGNED_16BITS,
158 SIGNED_16BITS, UNSIGNED_32BITS,
159 SIGNED_32BITS, REAL_32BITS,
160 REAL_64BITS };
161
162 /**
163 * Constructs an enum with the given name.
164 */
165 private SampleDimensionType( final String name, final int ordinal ) {
166 super( name, ordinal );
167 }
168
169 /**
170 * Returns the list of <code>SampleDimensionType</code>s.
171 *
172 * @return the list of <code>SampleDimensionType</code>s.
173 */
174 public static SampleDimensionType[] values() {
175 return VALUES.clone();
176 }
177
178 /**
179 * Returns the list of enumerations of the same kind than this enum.
180 */
181 @Override
182 public CodeList[] family() {
183 return values();
184 }
185 }