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.distribution;
021:
022: // J2SE direct dependencies
023: import java.util.Collection;
024:
025: // OpenGIS dependencies
026: import org.opengis.metadata.distribution.DigitalTransferOptions;
027: import org.opengis.metadata.distribution.Distribution;
028: import org.opengis.metadata.distribution.Distributor;
029: import org.opengis.metadata.distribution.Format;
030:
031: // Geotools dependencies
032: import org.geotools.metadata.iso.MetadataEntity;
033:
034: /**
035: * Information about the distributor of and options for obtaining the resource.
036: *
037: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/distribution/DistributionImpl.java $
038: * @version $Id: DistributionImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
039: * @author Martin Desruisseaux
040: * @author Touraïvane
041: *
042: * @since 2.1
043: */
044: public class DistributionImpl extends MetadataEntity implements
045: Distribution {
046: /**
047: * Serial number for interoperability with different versions.
048: */
049: private static final long serialVersionUID = -5899590027802365131L;
050:
051: /**
052: * Provides a description of the format of the data to be distributed.
053: */
054: private Collection distributionFormats;
055:
056: /**
057: * Provides information about the distributor.
058: */
059: private Collection distributors;
060:
061: /**
062: * Provides information about technical means and media by which a resource is obtained
063: * from the distributor.
064: */
065: private Collection transferOptions;
066:
067: /**
068: * Constructs an initially empty distribution.
069: */
070: public DistributionImpl() {
071: }
072:
073: /**
074: * Constructs a metadata entity initialized with the values from the specified metadata.
075: *
076: * @since 2.4
077: */
078: public DistributionImpl(final Distribution source) {
079: super (source);
080: }
081:
082: /**
083: * Provides a description of the format of the data to be distributed.
084: */
085: public synchronized Collection getDistributionFormats() {
086: return distributionFormats = nonNullCollection(
087: distributionFormats, Format.class);
088: }
089:
090: /**
091: * Set a description of the format of the data to be distributed.
092: */
093: public synchronized void setDistributionFormats(
094: final Collection newValues) {
095: distributionFormats = copyCollection(newValues,
096: distributionFormats, Format.class);
097: }
098:
099: /**
100: * Provides information about the distributor.
101: */
102: public synchronized Collection getDistributors() {
103: return distributors = nonNullCollection(distributors,
104: Distributor.class);
105: }
106:
107: /**
108: * Set information about the distributor.
109: */
110: public synchronized void setDistributors(final Collection newValues) {
111: distributors = copyCollection(newValues, distributors,
112: Distributor.class);
113: }
114:
115: /**
116: * Provides information about technical means and media by which a resource is obtained
117: * from the distributor.
118: */
119: public synchronized Collection getTransferOptions() {
120: return transferOptions = nonNullCollection(transferOptions,
121: DigitalTransferOptions.class);
122: }
123:
124: /**
125: * Set information about technical means and media by which a resource is obtained
126: * from the distributor.
127: */
128: public synchronized void setTransferOptions(
129: final Collection newValues) {
130: transferOptions = copyCollection(newValues, transferOptions,
131: DigitalTransferOptions.class);
132: }
133: }
|