Source for javax.xml.datatype.DatatypeConstants

   1: /* DatatypeConstants.java -- 
   2:    Copyright (C) 2004, 2005, 2006  Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10: 
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: package javax.xml.datatype;
  39: 
  40: import javax.xml.namespace.QName;
  41: 
  42: /**
  43:  * Basic data type constants.
  44:  *
  45:  * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
  46:  * @since 1.5
  47:  */
  48: public final class DatatypeConstants
  49: {
  50: 
  51:   private DatatypeConstants()
  52:   {
  53:     // to prevent instantiation
  54:   }
  55:   
  56:   /**
  57:    * Typesafe enumerated class representing the six fields of the
  58:    * <a href='Duration.html'>Duration</a> class.
  59:    */
  60:   public static final class Field
  61:   {
  62: 
  63:     final int id;
  64:     final String name;
  65: 
  66:     Field(int id, String name)
  67:     {
  68:       this.id = id;
  69:       this.name = name;
  70:     }
  71: 
  72:     public int getId()
  73:     {
  74:       return id;
  75:     }
  76:     
  77:     public String toString()
  78:     {
  79:       return name;
  80:     }
  81:     
  82:   }
  83: 
  84:   /**
  85:    * Value for January.
  86:    */
  87:   public static final int JANUARY = 1;
  88:   
  89:   /**
  90:    * Value for February.
  91:    */
  92:   public static final int FEBRUARY = 2;
  93:   
  94:   /**
  95:    * Value for March.
  96:    */
  97:   public static final int MARCH = 3;
  98:   
  99:   /**
 100:    * Value for April.
 101:    */
 102:   public static final int APRIL = 4;
 103:   
 104:   /**
 105:    * Value for May.
 106:    */
 107:   public static final int MAY = 5;
 108:   
 109:   /**
 110:    * Value for June.
 111:    */
 112:   public static final int JUNE = 6;
 113:   
 114:   /**
 115:    * Value for July.
 116:    */
 117:   public static final int JULY = 7;
 118:   
 119:   /**
 120:    * Value for August.
 121:    */
 122:   public static final int AUGUST = 8;
 123:   
 124:   /**
 125:    * Value for September.
 126:    */
 127:   public static final int SEPTEMBER = 9;
 128:   
 129:   /**
 130:    * Value for October.
 131:    */
 132:   public static final int OCTOBER = 10;
 133:   
 134:   /**
 135:    * Value for November.
 136:    */
 137:   public static final int NOVEMBER = 11;
 138:   
 139:   /**
 140:    * Value for December.
 141:    */
 142:   public static final int DECEMBER = 12;
 143:   
 144:   /**
 145:    * Comparison result.
 146:    */
 147:   public static final int LESSER = -1;
 148:   
 149:   /**
 150:    * Comparison result.
 151:    */
 152:   public static final int EQUAL = 0;
 153:   
 154:   /**
 155:    * Comparison result.
 156:    */
 157:   public static final int GREATER = 1;
 158:   
 159:   /**
 160:    * Comparison result.
 161:    */
 162:   public static final int INDETERMINATE = 2;
 163:   
 164:   /**
 165:    * Comparison result.
 166:    */
 167:   public static final int FIELD_UNDEFINED = -2147483648;
 168: 
 169:   /**
 170:    * Constant that represents the years field.
 171:    */
 172:   public static final Field YEARS = new Field(1, "YEARS");
 173:   
 174:   /**
 175:    * Constant that represents the months field.
 176:    */
 177:   public static final Field MONTHS = new Field(2, "MONTHS");
 178:   
 179:   /**
 180:    * Constant that represents the days field.
 181:    */
 182:   public static final Field DAYS = new Field(3, "DAYS");
 183:   
 184:   /**
 185:    * Constant that represents the hours field.
 186:    */
 187:   public static final Field HOURS = new Field(4, "HOURS");
 188:   
 189:   /**
 190:    * Constant that represents the minutes field.
 191:    */
 192:   public static final Field MINUTES = new Field(5, "MINUTES");
 193:   
 194:   /**
 195:    * Constant that represents the seconds field.
 196:    */
 197:   public static final Field SECONDS = new Field(6, "SECONDS");
 198: 
 199:   /**
 200:    * The qualified-name for the <code>dateTime</code> data type.
 201:    */
 202:   public static final QName DATETIME = new QName ("http://www.w3.org/2001/XMLSchema#dateTime", "");
 203:   
 204:   /**
 205:    * The qualified-name for the <code>time</code> data type.
 206:    */
 207:   public static final QName TIME = new QName ("http://www.w3.org/2001/XMLSchema#time", "");
 208:   
 209:   /**
 210:    * The qualified-name for the <code>date</code> data type.
 211:    */
 212:   public static final QName DATE = new QName ("http://www.w3.org/2001/XMLSchema#date", "");
 213:   
 214:   /**
 215:    * The qualified-name for the <code>gYearMonth</code> data type.
 216:    */
 217:   public static final QName GYEARMONTH = new QName ("http://www.w3.org/2001/XMLSchema#gYearMonth", "");
 218:   
 219:   /**
 220:    * The qualified-name for the <code>gMonthDay</code> data type.
 221:    */
 222:   public static final QName GMONTHDAY = new QName ("http://www.w3.org/2001/XMLSchema#gMonthDay", "");
 223:   
 224:   /**
 225:    * The qualified-name for the <code>gYear</code> data type.
 226:    */
 227:   public static final QName GYEAR = new QName ("http://www.w3.org/2001/XMLSchema#gYear", "");
 228:   
 229:   /**
 230:    * The qualified-name for the <code>gMonth</code> data type.
 231:    */
 232:   public static final QName GMONTH = new QName ("http://www.w3.org/2001/XMLSchema#gMonth", "");
 233:   
 234:   /**
 235:    * The qualified-name for the <code>gDay</code> data type.
 236:    */
 237:   public static final QName GDAY = new QName ("http://www.w3.org/2001/XMLSchema#gDay", "");
 238:   
 239:   /**
 240:    * The qualified-name for the <code>duration</code> data type.
 241:    */
 242:   public static final QName DURATION = new QName ("http://www.w3.org/2001/XMLSchema#duration", "");
 243:   
 244:   /**
 245:    * The qualified-name for the <code>dayTimeDuration</code> data type.
 246:    */
 247:   public static final QName DURATION_DAYTIME = new QName ("http://www.w3.org/2001/XMLSchema#dayTimeDuration", "");
 248:   
 249:   /**
 250:    * The qualified-name for the <code>yearMonthDuration</code> data type.
 251:    */
 252:   public static final QName DURATION_YEARMONTH = new QName ("http://www.w3.org/2001/XMLSchema#yearMonthDuration", "");
 253: 
 254:   /**
 255:    * XML Schema maximum timezone offset, in minutes.
 256:    */
 257:   public static final int MAX_TIMEZONE_OFFSET = -840;
 258:   
 259:   /**
 260:    * XML Schema minimum timezone offset, in minutes.
 261:    */
 262:   public static final int MIN_TIMEZONE_OFFSET = 840;
 263:   
 264: }