001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wcs/describecoverage/RangeSet.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    package org.deegree.ogcwebservices.wcs.describecoverage;
037    
038    import java.net.URI;
039    
040    import org.deegree.datatypes.values.ValueEnum;
041    import org.deegree.ogcbase.Description;
042    import org.deegree.ogcbase.OGCException;
043    import org.deegree.ogcwebservices.MetadataLink;
044    
045    /**
046     * @version $Revision: 18195 $
047     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
048     * @author last edited by: $Author: mschneider $
049     *
050     * @version 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
051     *
052     * @since 2.0
053     */
054    
055    public class RangeSet extends Description implements Cloneable {
056    
057        private URI semantic = null;
058    
059        private URI refSys = null;
060    
061        private String refSysLabel = null;
062    
063        private ValueEnum nullValues = null;
064    
065        private AxisDescription[] axisDescription = new AxisDescription[0];
066    
067        /**
068         * @param name
069         * @param label
070         * @throws OGCException
071         */
072        public RangeSet( String name, String label ) throws OGCException {
073            super( name, label );
074        }
075    
076        /**
077         * @param name
078         * @param label
079         * @param nullValues
080         * @param axisDescription
081         * @throws OGCException
082         */
083        public RangeSet( String name, String label, ValueEnum nullValues, AxisDescription[] axisDescription )
084                                throws OGCException {
085            super( name, label );
086            this.nullValues = nullValues;
087            setAxisDescription( axisDescription );
088        }
089    
090        /**
091         * @param name
092         * @param label
093         * @param description
094         * @param metadataLink
095         * @param semantic
096         * @param refSys
097         * @param refSysLabel
098         * @param nullValues
099         * @param axisDescription
100         * @throws OGCException
101         */
102        public RangeSet( String name, String label, String description, MetadataLink metadataLink, URI semantic,
103                         URI refSys, String refSysLabel, ValueEnum nullValues, AxisDescription[] axisDescription )
104                                throws OGCException {
105            super( name, label, description, metadataLink );
106            this.semantic = semantic;
107            this.refSys = refSys;
108            this.refSysLabel = refSysLabel;
109            this.nullValues = nullValues;
110            if ( axisDescription != null ) {
111                this.axisDescription = axisDescription;
112            }
113        }
114    
115        /**
116         * @return Returns the axisDescription.
117         */
118        public AxisDescription[] getAxisDescription() {
119            return axisDescription;
120        }
121    
122        /**
123         * @param axisDescription
124         *            The axisDescription to set.
125         */
126        public void setAxisDescription( AxisDescription[] axisDescription ) {
127            if ( axisDescription != null ) {
128                this.axisDescription = axisDescription;
129            }
130        }
131    
132        /**
133         * @return Returns the nullValues.
134         */
135        public ValueEnum getNullValues() {
136            return nullValues;
137        }
138    
139        /**
140         * @param nullValues
141         *            The nullValues to set.
142         */
143        public void setNullValues( ValueEnum nullValues ) {
144            this.nullValues = nullValues;
145        }
146    
147        /**
148         * @return Returns the refSys.
149         */
150        public URI getRefSys() {
151            return refSys;
152        }
153    
154        /**
155         * @param refSys
156         *            The refSys to set.
157         */
158        public void setRefSys( URI refSys ) {
159            this.refSys = refSys;
160        }
161    
162        /**
163         * @return Returns the refSysLabel.
164         */
165        public String getRefSysLabel() {
166            return refSysLabel;
167        }
168    
169        /**
170         * @param refSysLabel
171         *            The refSysLabel to set.
172         */
173        public void setRefSysLabel( String refSysLabel ) {
174            this.refSysLabel = refSysLabel;
175        }
176    
177        /**
178         * @return Returns the semantic.
179         */
180        public URI getSemantic() {
181            return semantic;
182        }
183    
184        /**
185         * @param semantic
186         *            The semantic to set.
187         */
188        public void setSemantic( URI semantic ) {
189            this.semantic = semantic;
190        }
191    
192        /**
193         * @see java.lang.Object#clone()
194         */
195        public Object clone() {
196            ValueEnum nullValues_ = null;
197            if ( nullValues_ != null ) {
198                nullValues_ = (ValueEnum) nullValues.clone();
199            }
200    
201            AxisDescription[] ad = new AxisDescription[axisDescription.length];
202            for ( int i = 0; i < ad.length; i++ ) {
203                ad[i] = (AxisDescription) axisDescription[i].clone();
204            }
205            Description des = (Description) super.clone();
206            try {
207                return new RangeSet( des.getName(), des.getLabel(), des.getDescription(), des.getMetadataLink(), semantic,
208                                     refSys, refSysLabel, nullValues_, ad );
209            } catch ( Exception e ) {
210            }
211            return null;
212        }
213    
214    }