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.quality;
021:
022: // J2SE direct dependencies
023: import java.util.Collection;
024:
025: // OpenGIS dependencies
026: import org.opengis.metadata.lineage.Lineage;
027: import org.opengis.metadata.quality.DataQuality;
028: import org.opengis.metadata.quality.Element;
029: import org.opengis.metadata.quality.Scope;
030:
031: // Geotools dependencies
032: import org.geotools.metadata.iso.MetadataEntity;
033:
034: /**
035: * Quality information for the data specified by a data quality scope.
036: *
037: * @since 2.1
038: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/quality/DataQualityImpl.java $
039: * @version $Id: DataQualityImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
040: * @author Martin Desruisseaux
041: * @author Touraïvane
042: */
043: public class DataQualityImpl extends MetadataEntity implements
044: DataQuality {
045: /**
046: * Serial number for interoperability with different versions.
047: */
048: private static final long serialVersionUID = 7964896551368382214L;
049:
050: /**
051: * The specific data to which the data quality information applies.
052: */
053: private Scope scope;
054:
055: /**
056: * Quantitative quality information for the data specified by the scope.
057: * Should be provided only if {@linkplain Scope#getLevel scope level} is
058: * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
059: */
060: private Collection reports;
061:
062: /**
063: * Non-quantitative quality information about the lineage of the data specified by the scope.
064: * Should be provided only if {@linkplain Scope#getLevel scope level} is
065: * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
066: */
067: private Lineage lineage;
068:
069: /**
070: * Constructs an initially empty data quality.
071: */
072: public DataQualityImpl() {
073: }
074:
075: /**
076: * Constructs a metadata entity initialized with the values from the specified metadata.
077: *
078: * @since 2.4
079: */
080: public DataQualityImpl(final DataQuality source) {
081: super (source);
082: }
083:
084: /**
085: * Creates a data quality initialized to the given scope.
086: */
087: public DataQualityImpl(Scope scope) {
088: setScope(scope);
089: }
090:
091: /**
092: * The specific data to which the data quality information applies.
093: */
094: public Scope getScope() {
095: return scope;
096: }
097:
098: /**
099: * Set the specific data to which the data quality information applies.
100: */
101: public synchronized void setScope(final Scope newValue) {
102: checkWritePermission();
103: scope = newValue;
104: }
105:
106: /**
107: * Quantitative quality information for the data specified by the scope.
108: * Should be provided only if {@linkplain Scope#getLevel scope level} is
109: * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
110: */
111: public synchronized Collection getReports() {
112: return reports = nonNullCollection(reports, Element.class);
113: }
114:
115: /**
116: * Set the quantitative quality information for the data specified by the scope.
117: * Should be provided only if {@linkplain Scope#getLevel scope level} is
118: * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
119: */
120: public synchronized void setReports(final Collection newValues) {
121: reports = copyCollection(newValues, reports, Element.class);
122: }
123:
124: /**
125: * Non-quantitative quality information about the lineage of the data specified by
126: * the scope. Should be provided only if {@linkplain Scope#getLevel scope level} is
127: * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
128: */
129: public Lineage getLineage() {
130: return lineage;
131: }
132:
133: /**
134: * Set the non-quantitative quality information about the lineage of the data specified
135: * by the scope. Should be provided only if {@linkplain Scope#getLevel scope level} is
136: * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
137: */
138: public synchronized void setLineage(final Lineage newValue) {
139: checkWritePermission();
140: lineage = newValue;
141: }
142: }
|