001: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/wcs/describecoverage/DomainSet.java $
002: /*---------------- FILE HEADER ------------------------------------------
003:
004: This file is part of deegree.
005: Copyright (C) 2001-2008 by:
006: EXSE, Department of Geography, University of Bonn
007: http://www.giub.uni-bonn.de/deegree/
008: lat/lon GmbH
009: http://www.lat-lon.de
010:
011: This library is free software; you can redistribute it and/or
012: modify it under the terms of the GNU Lesser General Public
013: License as published by the Free Software Foundation; either
014: version 2.1 of the License, or (at your option) any later version.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: Contact:
026:
027: Andreas Poth
028: lat/lon GmbH
029: Aennchenstr. 19
030: 53115 Bonn
031: Germany
032: E-Mail: poth@lat-lon.de
033:
034: Prof. Dr. Klaus Greve
035: Department of Geography
036: University of Bonn
037: Meckenheimer Allee 166
038: 53115 Bonn
039: Germany
040: E-Mail: greve@giub.uni-bonn.de
041:
042:
043: ---------------------------------------------------------------------------*/
044: package org.deegree.ogcwebservices.wcs.describecoverage;
045:
046: import org.deegree.datatypes.time.TimeSequence;
047: import org.deegree.ogcwebservices.wcs.WCSException;
048:
049: /**
050: * @version $Revision: 9345 $
051: * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
052: * @author last edited by: $Author: apoth $
053: *
054: * @version 1.0. $Revision: 9345 $, $Date: 2007-12-27 08:22:25 -0800 (Thu, 27 Dec 2007) $
055: *
056: * @since 2.0
057: */
058:
059: public class DomainSet implements Cloneable {
060:
061: private SpatialDomain spatialDomain = null;
062:
063: private TimeSequence timeSequence = null;
064:
065: /**
066: * @param spatialDomain
067: */
068: public DomainSet(SpatialDomain spatialDomain) throws WCSException {
069: setSpatialDomain(spatialDomain);
070: }
071:
072: /**
073: * @param timeSequence
074: */
075: public DomainSet(TimeSequence timeSequence) throws WCSException {
076: setTimeSequence(timeSequence);
077: }
078:
079: /**
080: * @param spatialDomain
081: * @param timeSequence
082: */
083: public DomainSet(SpatialDomain spatialDomain,
084: TimeSequence timeSequence) throws WCSException {
085: this .spatialDomain = spatialDomain;
086: this .timeSequence = timeSequence;
087: if (this .spatialDomain == null && this .timeSequence == null) {
088: throw new WCSException(
089: "at least spatialDomain or timeSequence must "
090: + "be <> null ");
091: }
092: }
093:
094: /**
095: * @return Returns the spatialDomain.
096: */
097: public SpatialDomain getSpatialDomain() {
098: return spatialDomain;
099: }
100:
101: /**
102: * @param spatialDomain
103: * The spatialDomain to set.
104: */
105: public void setSpatialDomain(SpatialDomain spatialDomain)
106: throws WCSException {
107: if (spatialDomain == null && this .timeSequence == null) {
108: throw new WCSException(
109: "spatialDomain must be <> null because timeSequence "
110: + "is already null");
111: }
112: this .spatialDomain = spatialDomain;
113: }
114:
115: /**
116: * @return Returns the timeSequence.
117: */
118: public TimeSequence getTimeSequence() {
119: return timeSequence;
120: }
121:
122: /**
123: * @param timeSequence
124: * The timeSequence to set.
125: */
126: public void setTimeSequence(TimeSequence timeSequence)
127: throws WCSException {
128: if (timeSequence == null && this .spatialDomain == null) {
129: throw new WCSException(
130: "timeSequence must be <> null because spatialDomain "
131: + "is already null");
132: }
133: this .timeSequence = timeSequence;
134: }
135:
136: /**
137: * @see java.lang.Object#clone()
138: */
139: public Object clone() {
140: SpatialDomain spatialDomain_ = null;
141: if (spatialDomain != null) {
142: spatialDomain_ = (SpatialDomain) spatialDomain.clone();
143: }
144: TimeSequence timeSequence_ = null;
145: if (timeSequence != null) {
146: timeSequence_ = (TimeSequence) timeSequence.clone();
147: }
148: try {
149: return new DomainSet(spatialDomain_, timeSequence_);
150: } catch (Exception e) {
151: }
152: return null;
153: }
154:
155: }
|