001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/datatypes/values/ValueRange.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.datatypes.values; 037 038 import java.io.Serializable; 039 import java.net.URI; 040 041 /** 042 * @version $Revision: 18195 $ 043 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a> 044 * @author last edited by: $Author: mschneider $ 045 * 046 * @version 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $ 047 * 048 * @since 2.0 049 */ 050 051 public class ValueRange implements Cloneable, Serializable { 052 053 private static final long serialVersionUID = 1L; 054 055 private TypedLiteral min = null; 056 057 private TypedLiteral max = null; 058 059 private TypedLiteral spacing = null; 060 061 private URI type = null; 062 063 private URI semantic = null; 064 065 private boolean atomic = false; 066 067 private Closure closure = new Closure(); 068 069 /** 070 * default: atomic = false closure = closed 071 * 072 * @param min 073 * @param max 074 * @param type 075 * @param semantic 076 */ 077 public ValueRange( TypedLiteral min, TypedLiteral max, URI type, URI semantic ) { 078 this.min = min; 079 this.max = max; 080 this.type = type; 081 this.semantic = semantic; 082 } 083 084 /** 085 * 086 * @param min 087 * @param max 088 * @param spacing 089 */ 090 public ValueRange( TypedLiteral min, TypedLiteral max, TypedLiteral spacing ) { 091 this.min = min; 092 this.max = max; 093 this.spacing = spacing; 094 } 095 096 /** 097 * @param min 098 * @param max 099 * @param type 100 * @param semantic 101 * @param atomic 102 * @param closure 103 */ 104 public ValueRange( TypedLiteral min, TypedLiteral max, URI type, URI semantic, boolean atomic, Closure closure ) { 105 this.min = min; 106 this.max = max; 107 this.type = type; 108 this.semantic = semantic; 109 this.atomic = atomic; 110 this.closure = closure; 111 } 112 113 /** 114 * @param min 115 * @param max 116 * @param spacing 117 * @param type 118 * @param semantic 119 * @param atomic 120 * @param closure 121 */ 122 public ValueRange( TypedLiteral min, TypedLiteral max, TypedLiteral spacing, URI type, URI semantic, 123 boolean atomic, Closure closure ) { 124 this.min = min; 125 this.max = max; 126 this.type = type; 127 this.semantic = semantic; 128 this.atomic = atomic; 129 this.closure = closure; 130 this.spacing = spacing; 131 } 132 133 /** 134 * @return Returns the atomic. 135 * 136 */ 137 public boolean isAtomic() { 138 return atomic; 139 } 140 141 /** 142 * @param atomic 143 * The atomic to set. 144 * 145 */ 146 public void setAtomic( boolean atomic ) { 147 this.atomic = atomic; 148 } 149 150 /** 151 * @return Returns the closure. 152 * 153 */ 154 public Closure getClosure() { 155 return closure; 156 } 157 158 /** 159 * @param closure 160 * The closure to set. 161 * 162 */ 163 public void setClosure( Closure closure ) { 164 this.closure = closure; 165 } 166 167 /** 168 * @return Returns the max. 169 * 170 */ 171 public TypedLiteral getMax() { 172 return max; 173 } 174 175 /** 176 * @param max 177 * The max to set. 178 * 179 */ 180 public void setMax( TypedLiteral max ) { 181 this.max = max; 182 } 183 184 /** 185 * @return Returns the min. 186 * 187 */ 188 public TypedLiteral getMin() { 189 return min; 190 } 191 192 /** 193 * @param min 194 * The min to set. 195 * 196 */ 197 public void setMin( TypedLiteral min ) { 198 this.min = min; 199 } 200 201 /** 202 * @return Returns the spacing. 203 */ 204 public TypedLiteral getSpacing() { 205 return spacing; 206 } 207 208 /** 209 * @param spacing 210 * The spacing to set. 211 */ 212 public void setSpacing( TypedLiteral spacing ) { 213 this.spacing = spacing; 214 } 215 216 /** 217 * @return Returns the semantic. 218 * 219 */ 220 public URI getSemantic() { 221 return semantic; 222 } 223 224 /** 225 * @param semantic 226 * The semantic to set. 227 * 228 */ 229 public void setSemantic( URI semantic ) { 230 this.semantic = semantic; 231 } 232 233 /** 234 * @return Returns the type. 235 * 236 */ 237 public URI getType() { 238 return type; 239 } 240 241 /** 242 * @param type 243 * The type to set. 244 * 245 */ 246 public void setType( URI type ) { 247 this.type = type; 248 } 249 250 /** 251 * @see java.lang.Object#clone() 252 */ 253 @Override 254 public Object clone() { 255 TypedLiteral min_ = (TypedLiteral) min.clone(); 256 TypedLiteral max_ = (TypedLiteral) max.clone(); 257 TypedLiteral space_ = (TypedLiteral) spacing.clone(); 258 Closure closure_ = new Closure( closure.value ); 259 return new ValueRange( min_, max_, space_, type, semantic, atomic, closure_ ); 260 } 261 262 }