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.lineage;
021:
022: // J2SE direct dependencies
023: import java.util.Collection;
024:
025: // OpenGIS dependencies
026: import org.opengis.metadata.citation.Citation;
027: import org.opengis.metadata.extent.Extent;
028: import org.opengis.metadata.identification.RepresentativeFraction;
029: import org.opengis.metadata.lineage.Source;
030: import org.opengis.metadata.lineage.ProcessStep;
031: import org.opengis.referencing.ReferenceSystem;
032: import org.opengis.util.InternationalString;
033:
034: // Geotools dependencies
035: import org.geotools.metadata.iso.MetadataEntity;
036: import org.geotools.metadata.iso.identification.RepresentativeFractionImpl;
037:
038: /**
039: * Information about the source data used in creating the data specified by the scope.
040: *
041: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/lineage/SourceImpl.java $
042: * @version $Id: SourceImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
043: * @author Martin Desruisseaux
044: * @author Touraïvane
045: *
046: * @since 2.1
047: */
048: public class SourceImpl extends MetadataEntity implements Source {
049: /**
050: * Serial number for interoperability with different versions.
051: */
052: private static final long serialVersionUID = 2660914446466438044L;
053:
054: /**
055: * Detailed description of the level of the source data.
056: */
057: private InternationalString description;
058:
059: /**
060: * Denominator of the representative fraction on a source map.
061: */
062: private RepresentativeFraction scaleDenominator;
063:
064: /**
065: * Spatial reference system used by the source data.
066: */
067: private ReferenceSystem sourceReferenceSystem;
068:
069: /**
070: * Recommended reference to be used for the source data.
071: */
072: private Citation sourceCitation;
073:
074: /**
075: * Information about the spatial, vertical and temporal extent of the source data.
076: */
077: private Collection sourceExtents;
078:
079: /**
080: * Information about an event in the creation process for the source data.
081: */
082: private Collection sourceSteps;
083:
084: /**
085: * Creates an initially empty source.
086: */
087: public SourceImpl() {
088: }
089:
090: /**
091: * Constructs a metadata entity initialized with the values from the specified metadata.
092: *
093: * @since 2.4
094: */
095: public SourceImpl(final Source source) {
096: super (source);
097: }
098:
099: /**
100: * Creates a source initialized with the given description.
101: */
102: public SourceImpl(final InternationalString description) {
103: setDescription(description);
104: }
105:
106: /**
107: * Returns a detailed description of the level of the source data.
108: */
109: public InternationalString getDescription() {
110: return description;
111: }
112:
113: /**
114: * Set a detailed description of the level of the source data.
115: */
116: public synchronized void setDescription(
117: final InternationalString newValue) {
118: checkWritePermission();
119: description = newValue;
120: }
121:
122: /**
123: * Returns the denominator of the representative fraction on a source map.
124: */
125: public synchronized RepresentativeFraction getScaleDenominator() {
126: return scaleDenominator;
127: }
128:
129: /**
130: * Set the denominator of the representative fraction on a source map.
131: *
132: * @deprecated Use {@link #setScaleDenominator(RepresentativeFraction)}.
133: */
134: public void setScaleDenominator(final long newValue) {
135: setScaleDenominator(new RepresentativeFractionImpl(newValue));
136: }
137:
138: /**
139: * Set the denominator of the representative fraction on a source map.
140: *
141: * @since 2.4
142: */
143: public synchronized void setScaleDenominator(
144: final RepresentativeFraction newValue) {
145: checkWritePermission();
146: scaleDenominator = newValue;
147: }
148:
149: /**
150: * Returns the spatial reference system used by the source data.
151: */
152: public ReferenceSystem getSourceReferenceSystem() {
153: return sourceReferenceSystem;
154: }
155:
156: /**
157: * Set the spatial reference system used by the source data.
158: */
159: public synchronized void setSourceReferenceSystem(
160: final ReferenceSystem newValue) {
161: checkWritePermission();
162: sourceReferenceSystem = newValue;
163: }
164:
165: /**
166: * Returns the recommended reference to be used for the source data.
167: */
168: public Citation getSourceCitation() {
169: return sourceCitation;
170: }
171:
172: /**
173: * Set the recommended reference to be used for the source data.
174: */
175: public synchronized void setSourceCitation(final Citation newValue) {
176: checkWritePermission();
177: sourceCitation = newValue;
178: }
179:
180: /**
181: * Returns tiInformation about the spatial, vertical and temporal extent
182: * of the source data.
183: */
184: public synchronized Collection getSourceExtents() {
185: return sourceExtents = nonNullCollection(sourceExtents,
186: Extent.class);
187: }
188:
189: /**
190: * Information about the spatial, vertical and temporal extent of the source data.
191: */
192: public synchronized void setSourceExtents(final Collection newValues) {
193: sourceExtents = copyCollection(newValues, sourceExtents,
194: Extent.class);
195: }
196:
197: /**
198: * Returns information about an event in the creation process for the source data.
199: */
200: public synchronized Collection getSourceSteps() {
201: return sourceSteps = nonNullCollection(sourceSteps,
202: ProcessStep.class);
203: }
204:
205: /**
206: * Set information about an event in the creation process for the source data.
207: */
208: public synchronized void setSourceSteps(final Collection newValues) {
209: sourceSteps = copyCollection(newValues, sourceSteps,
210: ProcessStep.class);
211: }
212: }
|