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.identification;
021:
022: // J2SE direct dependencies
023: import java.util.Collection;
024: import java.util.Collections;
025: import java.util.Locale;
026: import java.nio.charset.Charset;
027:
028: // OpenGIS dependencies
029: import org.opengis.metadata.citation.Citation;
030: import org.opengis.metadata.identification.DataIdentification;
031: import org.opengis.metadata.extent.Extent;
032: import org.opengis.metadata.extent.GeographicBoundingBox;
033: import org.opengis.metadata.identification.CharacterSet;
034: import org.opengis.metadata.identification.Resolution;
035: import org.opengis.metadata.identification.TopicCategory;
036: import org.opengis.metadata.spatial.SpatialRepresentationType;
037: import org.opengis.util.InternationalString;
038:
039: /**
040: * Information required to identify a dataset.
041: *
042: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/identification/DataIdentificationImpl.java $
043: * @version $Id: DataIdentificationImpl.java 25193 2007-04-18 13:37:38Z desruisseaux $
044: * @author Martin Desruisseaux
045: * @author Touraïvane
046: *
047: * @since 2.1
048: */
049: public class DataIdentificationImpl extends IdentificationImpl
050: implements DataIdentification {
051: /**
052: * Serial number for compatibility with different versions.
053: */
054: private static final long serialVersionUID = -4418520352804939785L;
055:
056: /**
057: * Method used to spatially represent geographic information.
058: */
059: private Collection spatialRepresentationTypes;
060:
061: /**
062: * Factor which provides a general understanding of the density of spatial data
063: * in the dataset.
064: */
065: private Collection spatialResolutions;
066:
067: /**
068: * Language(s) used within the dataset.
069: */
070: private Collection language;
071:
072: /**
073: * Full name of the character coding standard used for the dataset.
074: */
075: private Collection/*<CharacterSet>*/characterSets;
076:
077: /**
078: * Main theme(s) of the datset.
079: */
080: private Collection topicCategories;
081:
082: /**
083: * Minimum bounding rectangle within which data is available.
084: * Only one of {@code getGeographicBox()} and {@link #getGeographicDescription()}
085: * should be provided.
086: *
087: * @deprecated not in ISO 19115:2003
088: */
089: private Collection geographicBox;
090:
091: /**
092: * Description of the geographic area within which data is available.
093: * Only one of {@link #getGeographicBox()} and {@code getGeographicDescription()}
094: * should be provided.
095: *
096: * @deprecated not in ISO 19115:2003
097: */
098: private Collection geographicDescription;
099:
100: /**
101: * Description of the dataset in the producer’s processing environment, including items
102: * such as the software, the computer operating system, file name, and the dataset size
103: */
104: private InternationalString environmentDescription;
105:
106: /**
107: * Additional extent information including the bounding polygon, vertical, and temporal
108: * extent of the dataset.
109: */
110: private Collection extent;
111:
112: /**
113: * Any other descriptive information about the dataset.
114: */
115: private InternationalString supplementalInformation;
116:
117: /**
118: * Constructs an initially empty data identification.
119: */
120: public DataIdentificationImpl() {
121: }
122:
123: /**
124: * Constructs a metadata entity initialized with the values from the specified metadata.
125: *
126: * @since 2.4
127: */
128: public DataIdentificationImpl(final DataIdentification source) {
129: super (source);
130: }
131:
132: /**
133: * Creates a data identification initialized to the specified values.
134: */
135: public DataIdentificationImpl(final Citation citation,
136: final InternationalString abstracts,
137: final Collection language, final Collection topicCategories) {
138: super (citation, abstracts);
139: setLanguage(language);
140: setTopicCategories(topicCategories);
141: }
142:
143: /**
144: * Method used to spatially represent geographic information.
145: */
146: public synchronized Collection getSpatialRepresentationTypes() {
147: return spatialRepresentationTypes = nonNullCollection(
148: spatialRepresentationTypes,
149: SpatialRepresentationType.class);
150: }
151:
152: /**
153: * Set the method used to spatially represent geographic information.
154: */
155: public synchronized void setSpatialRepresentationTypes(
156: final Collection newValues) {
157: spatialRepresentationTypes = copyCollection(newValues,
158: spatialRepresentationTypes,
159: SpatialRepresentationType.class);
160: }
161:
162: /**
163: * Factor which provides a general understanding of the density of spatial data
164: * in the dataset.
165: */
166: public synchronized Collection getSpatialResolutions() {
167: return spatialResolutions = nonNullCollection(
168: spatialResolutions, Resolution.class);
169: }
170:
171: /**
172: * Set the factor which provides a general understanding of the density of spatial data
173: * in the dataset.
174: */
175: public synchronized void setSpatialResolutions(
176: final Collection newValues) {
177: spatialResolutions = copyCollection(newValues,
178: spatialResolutions, Resolution.class);
179: }
180:
181: /**
182: * Language(s) used within the dataset.
183: */
184: public synchronized Collection getLanguage() {
185: return language = nonNullCollection(language, Locale.class);
186: }
187:
188: /**
189: * Set the language(s) used within the dataset.
190: */
191: public synchronized void setLanguage(final Collection newValues) {
192: language = copyCollection(newValues, language, Locale.class);
193: }
194:
195: /**
196: * Full name of the character coding standard used for the dataset.
197: *
198: * @deprecated Use {@link #getCharacterSets} instead.
199: */
200: public Charset getCharacterSet() {
201: final Collection characterSet = getCharacterSets();
202: return characterSet.isEmpty() ? null
203: : ((CharacterSet) characterSet.iterator().next())
204: .toCharset();
205: }
206:
207: /**
208: * Full name of the character coding standard used for the dataset.
209: */
210: public synchronized Collection getCharacterSets() {
211: return characterSets = nonNullCollection(characterSets,
212: CharacterSet.class);
213: }
214:
215: /**
216: * Set the full name of the character coding standard used for the dataset.
217: *
218: * @deprecated Use {@link #setCharacterSets} instead.
219: */
220: public synchronized void setCharacterSet(final Charset newValue) {
221: throw new UnsupportedOperationException();
222: }
223:
224: /**
225: * Set the full name of the character coding standard used for the dataset.
226: */
227: public synchronized void setCharacterSets(
228: final Collection/*<CharacterSet>*/newValues) {
229: characterSets = copyCollection(newValues, characterSets,
230: CharacterSet.class);
231: }
232:
233: /**
234: * Main theme(s) of the datset.
235: */
236: public synchronized Collection getTopicCategories() {
237: return topicCategories = nonNullCollection(topicCategories,
238: TopicCategory.class);
239: }
240:
241: /**
242: * Set the main theme(s) of the datset.
243: */
244: public synchronized void setTopicCategories(
245: final Collection newValues) {
246: topicCategories = copyCollection(newValues, topicCategories,
247: TopicCategory.class);
248: }
249:
250: /**
251: * Minimum bounding rectangle within which data is available.
252: * Only one of {@code getGeographicBox()} and {@link #getGeographicDescription()}
253: * should be provided.
254: *
255: * @deprecated not in ISO 19115:2003
256: */
257: public synchronized Collection getGeographicBox() {
258: return geographicBox = nonNullCollection(geographicBox,
259: GeographicBoundingBox.class);
260: }
261:
262: /**
263: * Set the minimum bounding rectangle within which data is available.
264: *
265: * @deprecated not in ISO 19115:2003
266: */
267: public synchronized void setGeographicBox(final Collection newValues) {
268: geographicBox = copyCollection(newValues, geographicBox,
269: GeographicBoundingBox.class);
270: }
271:
272: /**
273: * Description of the geographic area within which data is available.
274: * Only one of {@link #getGeographicBox()} and {@code getGeographicDescription()}
275: * should be provided.
276: *
277: * @deprecated not in ISO 19115:2003
278: */
279: public synchronized Collection getGeographicDescription() {
280: return geographicDescription = nonNullCollection(
281: geographicDescription, InternationalString.class);
282: }
283:
284: /**
285: * Set the description of the geographic area within which data is available.
286: *
287: * @deprecated not in ISO 19115:2003
288: */
289: public synchronized void setGeographicDescription(
290: final Collection newValues) {
291: geographicDescription = copyCollection(newValues,
292: geographicDescription, InternationalString.class);
293: }
294:
295: /**
296: * Description of the dataset in the producer’s processing environment, including items
297: * such as the software, the computer operating system, file name, and the dataset size.
298: */
299: public InternationalString getEnvironmentDescription() {
300: return environmentDescription;
301: }
302:
303: /**
304: * Set the description of the dataset in the producer’s processing environment.
305: */
306: public synchronized void setEnvironmentDescription(
307: final InternationalString newValue) {
308: checkWritePermission();
309: environmentDescription = newValue;
310: }
311:
312: /**
313: * Additional extent information including the bounding polygon, vertical, and temporal
314: * extent of the dataset.
315: */
316: public synchronized Collection getExtent() {
317: return extent = nonNullCollection(extent, Extent.class);
318: }
319:
320: /**
321: * Set additional extent information.
322: */
323: public synchronized void setExtent(final Collection newValues) {
324: extent = copyCollection(newValues, extent, Extent.class);
325: }
326:
327: /**
328: * Any other descriptive information about the dataset.
329: */
330: public InternationalString getSupplementalInformation() {
331: return supplementalInformation;
332: }
333:
334: /**
335: * Set any other descriptive information about the dataset.
336: */
337: public synchronized void setSupplementalInformation(
338: final InternationalString newValue) {
339: checkWritePermission();
340: supplementalInformation = newValue;
341: }
342: }
|