001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2004, Institut de Recherche pour le Développement
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * This package contains documentation from OpenGIS specifications.
018: * OpenGIS consortium's work is fully acknowledged here.
019: */
020: package org.geotools.metadata.iso.content;
021:
022: // J2SE extensions
023: import javax.units.Unit;
024:
025: // OpenGIS dependencies
026: import org.opengis.metadata.content.Band;
027:
028: /**
029: * Range of wavelengths in the electromagnetic spectrum.
030: *
031: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/content/BandImpl.java $
032: * @version $Id: BandImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
033: * @author Martin Desruisseaux
034: * @author Touraïvane
035: *
036: * @since 2.1
037: */
038: public class BandImpl extends RangeDimensionImpl implements Band {
039: /**
040: * Serial number for interoperability with different versions.
041: */
042: private static final long serialVersionUID = -2302918545469034653L;
043:
044: /**
045: * Longest wavelength that the sensor is capable of collecting within a designated band.
046: */
047: private Double maxValue;
048:
049: /**
050: * Shortest wavelength that the sensor is capable of collecting within a designated band.
051: */
052: private Double minValue;
053:
054: /**
055: * Units in which sensor wavelengths are expressed. Should be non-null if
056: * {@linkplain #getMinValue min value} or {@linkplain #getMaxValue max value}
057: * are provided.
058: */
059: private Unit units;
060:
061: /**
062: * Wavelength at which the response is the highest.
063: * {@code null} if unspecified.
064: */
065: private Double peakResponse;
066:
067: /**
068: * Maximum number of significant bits in the uncompressed representation for the value
069: * in each band of each pixel.
070: * {@code null} if unspecified.
071: */
072: private Integer bitsPerValue;
073:
074: /**
075: * Number of discrete numerical values in the grid data.
076: * {@code null} if unspecified.
077: */
078: private Integer toneGradation;
079:
080: /**
081: * Scale factor which has been applied to the cell value.
082: * {@code null} if unspecified.
083: */
084: private Double scaleFactor;
085:
086: /**
087: * The physical value corresponding to a cell value of zero.
088: * {@code null} if unspecified.
089: */
090: private Double offset;
091:
092: /**
093: * Constructs an initially empty band.
094: */
095: public BandImpl() {
096: }
097:
098: /**
099: * Constructs a metadata entity initialized with the values from the specified metadata.
100: *
101: * @since 2.4
102: */
103: public BandImpl(final Band source) {
104: super (source);
105: }
106:
107: /**
108: * Returns the longest wavelength that the sensor is capable of collecting within
109: * a designated band. Returns {@code null} if unspecified.
110: */
111: public Double getMaxValue() {
112: return maxValue;
113: }
114:
115: /**
116: * Set the longest wavelength that the sensor is capable of collecting within a
117: * designated band. Returns {@code null} if unspecified.
118: */
119: public synchronized void setMaxValue(final Double newValue) {
120: checkWritePermission();
121: maxValue = newValue;
122: }
123:
124: /**
125: * Returns the shortest wavelength that the sensor is capable of collecting
126: * within a designated band.
127: */
128: public Double getMinValue() {
129: return minValue;
130: }
131:
132: /**
133: * Set the shortest wavelength that the sensor is capable of collecting within
134: * a designated band.
135: */
136: public synchronized void setMinValue(final Double newValue) {
137: checkWritePermission();
138: minValue = newValue;
139: }
140:
141: /**
142: * Returns the units in which sensor wavelengths are expressed. Should be non-null
143: * if {@linkplain #getMinValue min value} or {@linkplain #getMaxValue max value}
144: * are provided.
145: */
146: public Unit getUnits() {
147: return units;
148: }
149:
150: /**
151: * Set the units in which sensor wavelengths are expressed. Should be non-null if
152: * {@linkplain #getMinValue min value} or {@linkplain #getMaxValue max value}
153: * are provided.
154: */
155: public synchronized void setUnits(final Unit newValue) {
156: checkWritePermission();
157: units = newValue;
158: }
159:
160: /**
161: * Returns the wavelength at which the response is the highest.
162: * Returns {@code null} if unspecified.
163: */
164: public Double getPeakResponse() {
165: return peakResponse;
166: }
167:
168: /**
169: * Set the wavelength at which the response is the highest.
170: */
171: public synchronized void setPeakResponse(final Double newValue) {
172: checkWritePermission();
173: peakResponse = newValue;
174: }
175:
176: /**
177: * Returns the maximum number of significant bits in the uncompressed
178: * representation for the value in each band of each pixel.
179: * Returns {@code null} if unspecified.
180: */
181: public Integer getBitsPerValue() {
182: return bitsPerValue;
183: }
184:
185: /**
186: * Set the maximum number of significant bits in the uncompressed representation
187: * for the value in each band of each pixel.
188: */
189: public synchronized void setBitsPerValue(final Integer newValue) {
190: checkWritePermission();
191: bitsPerValue = newValue;
192: }
193:
194: /**
195: * Returns the number of discrete numerical values in the grid data.
196: * Returns {@code null} if unspecified.
197: */
198: public Integer getToneGradation() {
199: return toneGradation;
200: }
201:
202: /**
203: * Set the number of discrete numerical values in the grid data.
204: */
205: public synchronized void setToneGradation(final Integer newValue) {
206: checkWritePermission();
207: toneGradation = newValue;
208: }
209:
210: /**
211: * Returns the scale factor which has been applied to the cell value.
212: * Returns {@code null} if unspecified.
213: */
214: public Double getScaleFactor() {
215: return scaleFactor;
216: }
217:
218: /**
219: * Set the scale factor which has been applied to the cell value.
220: */
221: public synchronized void setScaleFactor(final Double newValue) {
222: checkWritePermission();
223: scaleFactor = newValue;
224: }
225:
226: /**
227: * Returns the physical value corresponding to a cell value of zero.
228: * Returns {@code null} if unspecified.
229: */
230: public Double getOffset() {
231: return offset;
232: }
233:
234: /**
235: * Set the physical value corresponding to a cell value of zero.
236: */
237: public synchronized void setOffset(final Double newValue) {
238: checkWritePermission();
239: offset = newValue;
240: }
241: }
|