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: import java.util.Date;
025:
026: // OpenGIS dependencies
027: import org.opengis.metadata.citation.ResponsibleParty;
028: import org.opengis.metadata.lineage.Source;
029: import org.opengis.metadata.lineage.ProcessStep;
030: import org.opengis.util.InternationalString;
031:
032: // Geotools dependencies
033: import org.geotools.metadata.iso.MetadataEntity;
034:
035: /**
036: * Description of the event, including related parameters or tolerances.
037: *
038: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/lineage/ProcessStepImpl.java $
039: * @version $Id: ProcessStepImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
040: * @author Martin Desruisseaux
041: * @author Touraïvane
042: *
043: * @since 2.1
044: */
045: public class ProcessStepImpl extends MetadataEntity implements
046: ProcessStep {
047: /**
048: * Serial number for interoperability with different versions.
049: */
050: private static final long serialVersionUID = 4629429337326490722L;
051:
052: /**
053: * Description of the event, including related parameters or tolerances.
054: */
055: private InternationalString description;
056:
057: /**
058: * Requirement or purpose for the process step.
059: */
060: private InternationalString rationale;
061:
062: /**
063: * Date and time or range of date and time on or over which the process step occurred,
064: * in milliseconds ellapsed since January 1st, 1970. If there is no such date, then this
065: * field is set to the special value {@link Long#MIN_VALUE}.
066: */
067: private long date;
068:
069: /**
070: * Identification of, and means of communication with, person(s) and
071: * organization(s) associated with the process step.
072: */
073: private Collection processors;
074:
075: /**
076: * Information about the source data used in creating the data specified by the scope.
077: */
078: private Collection sources;
079:
080: /**
081: * Creates an initially empty process step.
082: */
083: public ProcessStepImpl() {
084: }
085:
086: /**
087: * Constructs a metadata entity initialized with the values from the specified metadata.
088: *
089: * @since 2.4
090: */
091: public ProcessStepImpl(final ProcessStep source) {
092: super (source);
093: }
094:
095: /**
096: * Creates a process step initialized to the given description.
097: */
098: public ProcessStepImpl(final InternationalString description) {
099: setDescription(description);
100: }
101:
102: /**
103: * Returns the description of the event, including related parameters or tolerances.
104: */
105: public InternationalString getDescription() {
106: return description;
107: }
108:
109: /**
110: * Set the description of the event, including related parameters or tolerances.
111: */
112: public synchronized void setDescription(
113: final InternationalString newValue) {
114: checkWritePermission();
115: description = newValue;
116: }
117:
118: /**
119: * Returns the requirement or purpose for the process step.
120: */
121: public InternationalString getRationale() {
122: return rationale;
123: }
124:
125: /**
126: * Set the requirement or purpose for the process step.
127: */
128: public synchronized void setRationale(
129: final InternationalString newValue) {
130: checkWritePermission();
131: rationale = newValue;
132: }
133:
134: /**
135: * Returns the date and time or range of date and time on or over which
136: * the process step occurred.
137: */
138: public synchronized Date getDate() {
139: return (date != Long.MIN_VALUE) ? new Date(date) : null;
140: }
141:
142: /**
143: * Set the date and time or range of date and time on or over which the process
144: * step occurred.
145: */
146: public synchronized void setDate(final Date newValue) {
147: checkWritePermission();
148: date = (newValue != null) ? newValue.getTime() : Long.MIN_VALUE;
149: }
150:
151: /**
152: * Returns the identification of, and means of communication with, person(s) and
153: * organization(s) associated with the process step.
154: */
155: public synchronized Collection getProcessors() {
156: return processors = nonNullCollection(processors,
157: ResponsibleParty.class);
158: }
159:
160: /**
161: * Identification of, and means of communication with, person(s) and
162: * organization(s) associated with the process step.
163: */
164: public synchronized void setProcessors(final Collection newValues) {
165: processors = copyCollection(newValues, processors,
166: ResponsibleParty.class);
167: }
168:
169: /**
170: * Returns the information about the source data used in creating the data specified
171: * by the scope.
172: */
173: public synchronized Collection getSources() {
174: return sources = nonNullCollection(sources, Source.class);
175: }
176:
177: /**
178: * Information about the source data used in creating the data specified by the scope.
179: */
180: public synchronized void setSources(final Collection newValues) {
181: sources = copyCollection(newValues, sources, Source.class);
182: }
183: }
|