001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/ogcwebservices/wms/capabilities/Extent.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.wms.capabilities;
045    
046    
047    
048    /**
049     * The Extent element indicates what _values_ along a dimension are valid.
050     * <p>----------------------------------------------------------------------</p>
051     *
052     * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
053     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a>
054     * @version $Revision: 9345 $
055     */
056    public class Extent {
057        private String default_ = null;
058        private String name = null;
059        private boolean useNearestValue = false;
060        private String value = null;
061    
062        /**
063        * constructor initializing the class with the <Extent>
064        */
065        Extent( String name, String default_, boolean useNearestValue ) {
066            setName( name );
067            setDefault( default_ );
068            setUseNearestValue( useNearestValue );
069        }
070        
071        /**
072         * constructor initializing the class with the <Extent>
073         * @param name 
074         * @param default_ 
075         * @param useNearestValue 
076         * @param value 
077         */
078        public Extent( String name, String default_, boolean useNearestValue, String value ) {
079             this( name, default_, useNearestValue );
080             this.value = value;
081         }
082    
083        /**
084         * @return the name of the extent
085         */
086        public String getName() {
087            return name;
088        }
089    
090        /**
091        * sets the name of the extent
092         * @param name 
093        */
094        public void setName( String name ) {
095            this.name = name;
096        }
097    
098        /**
099         * @return the default extent
100         */
101        public String getDefault() {
102            return default_;
103        }
104    
105        /**
106        * sets the default extent
107         * @param default_ 
108        */
109        public void setDefault( String default_ ) {
110            this.default_ = default_;
111        }
112    
113        /**
114         * @return true if a WMS should use the extent that is nearest to 
115         * the requested level.
116         */
117        public boolean useNearestValue() {
118            return useNearestValue;
119        }
120    
121        /**
122        * sets true if a WMS should use the extent that is nearest to 
123        * the requested level.
124         * @param useNearestValue 
125        */
126        public void setUseNearestValue( boolean useNearestValue ) {
127            this.useNearestValue = useNearestValue;
128        }
129        
130        /**
131         * 
132         * @return the value
133         */
134        public String getValue() {
135            return value;
136        }
137        
138        /**
139         * 
140         * @param value
141         */
142        public void setValue( String value ) {
143            this.value = value;
144        }
145        
146        @Override
147        public String toString() {
148            String ret = null;
149            ret = "name = " + name + "\n";
150            ret += ( "default_ = " + default_ + "\n" );
151            ret += ( "useNearestValue = " + useNearestValue + "\n" );
152            return ret;
153        }
154       
155    }