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.maintenance.ScopeCode;
027: import org.opengis.metadata.lineage.Lineage;
028: import org.opengis.metadata.lineage.ProcessStep;
029: import org.opengis.metadata.lineage.Source;
030: import org.opengis.util.InternationalString;
031:
032: // Geotools dependencies
033: import org.geotools.metadata.iso.MetadataEntity;
034: import org.geotools.metadata.iso.quality.ScopeImpl;
035:
036: /**
037: * Information about the events or source data used in constructing the data specified by
038: * the scope or lack of knowledge about lineage.
039: *
040: * Only one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps process steps}
041: * and {@link #getSources sources} should be provided.
042: *
043: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/lineage/LineageImpl.java $
044: * @version $Id: LineageImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
045: * @author Martin Desruisseaux
046: * @author Touraïvane
047: *
048: * @since 2.1
049: */
050: public class LineageImpl extends MetadataEntity implements Lineage {
051: /**
052: * Serial number for interoperability with different versions.
053: */
054: private static final long serialVersionUID = 3351230301999744987L;
055:
056: /**
057: * General explanation of the data producer’s knowledge about the lineage of a dataset.
058: * Should be provided only if {@linkplain ScopeImpl#getLevel scope level} is
059: * {@linkplain ScopeCode#DATASET dataset} or {@linkplain ScopeCode#SERIES series}.
060: */
061: private InternationalString statement;
062:
063: /**
064: * Information about an event in the creation process for the data specified by the scope.
065: */
066: private Collection processSteps;
067:
068: /**
069: * Information about the source data used in creating the data specified by the scope.
070: */
071: private Collection sources;
072:
073: /**
074: * Constructs an initially empty lineage.
075: */
076: public LineageImpl() {
077: }
078:
079: /**
080: * Constructs a metadata entity initialized with the values from the specified metadata.
081: *
082: * @since 2.4
083: */
084: public LineageImpl(final Lineage source) {
085: super (source);
086: }
087:
088: /**
089: * Returns the general explanation of the data producer’s knowledge about the lineage
090: * of a dataset. Should be provided only if {@linkplain ScopeImpl#getLevel scope level}
091: * is {@linkplain ScopeCode#DATASET dataset} or {@linkplain ScopeCode#SERIES series}.
092: */
093: public InternationalString getStatement() {
094: return statement;
095: }
096:
097: /**
098: * Set the general explanation of the data producer’s knowledge about the lineage
099: * of a dataset.
100: */
101: public synchronized void setStatement(
102: final InternationalString newValue) {
103: checkWritePermission();
104: statement = newValue;
105: }
106:
107: /**
108: * Returns the information about an event in the creation process for the data
109: * specified by the scope.
110: */
111: public synchronized Collection getProcessSteps() {
112: return processSteps = nonNullCollection(processSteps,
113: ProcessStep.class);
114: }
115:
116: /**
117: * Set information about an event in the creation process for the data specified
118: * by the scope.
119: */
120: public synchronized void setProcessSteps(final Collection newValues) {
121: processSteps = copyCollection(newValues, processSteps,
122: ProcessStep.class);
123: }
124:
125: /**
126: * Information about the source data used in creating the data specified by the scope.
127: */
128: public synchronized Collection getSources() {
129: return sources = nonNullCollection(sources, Source.class);
130: }
131:
132: /**
133: * Information about the source data used in creating the data specified by the scope.
134: */
135: public synchronized void setSources(final Collection newValues) {
136: sources = copyCollection(newValues, sources, Source.class);
137: }
138: }
|