Merge from the pain train
[official-gcc.git] / libjava / javax / xml / datatype / DatatypeConstants.java
blob5724502e7e7cfd49244305122f13c6662bf1d589
1 /* DatatypeConstants.java --
2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
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.
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. */
38 package javax.xml.datatype;
40 import javax.xml.namespace.QName;
42 /**
43 * Basic data type constants.
45 * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
46 * @since 1.3
48 public final class DatatypeConstants
51 /**
52 * Typesafe enumerated class representing the six fields of the
53 * <a href='Duration.html'>Duration</a> class.
55 public static final class Field
58 final int id;
59 final String name;
61 Field(int id, String name)
63 this.id = id;
64 this.name = name;
67 public int getId()
69 return id;
72 public String toString()
74 return name;
79 /**
80 * Value for January.
82 public static final int JANUARY = 1;
84 /**
85 * Value for February.
87 public static final int FEBRUARY = 2;
89 /**
90 * Value for March.
92 public static final int MARCH = 3;
94 /**
95 * Value for April.
97 public static final int APRIL = 4;
99 /**
100 * Value for May.
102 public static final int MAY = 5;
105 * Value for June.
107 public static final int JUNE = 6;
110 * Value for July.
112 public static final int JULY = 7;
115 * Value for August.
117 public static final int AUGUST = 8;
120 * Value for September.
122 public static final int SEPTEMBER = 9;
125 * Value for October.
127 public static final int OCTOBER = 10;
130 * Value for November.
132 public static final int NOVEMBER = 11;
135 * Value for December.
137 public static final int DECEMBER = 12;
140 * Comparison result.
142 public static final int LESSER = -1;
145 * Comparison result.
147 public static final int EQUAL = 0;
150 * Comparison result.
152 public static final int GREATER = 1;
155 * Comparison result.
157 public static final int INDETERMINATE = 2;
160 * Comparison result.
162 public static final int FIELD_UNDEFINED = -2147483648;
165 * Constant that represents the years field.
167 public static final Field YEARS = new Field(1, "YEARS");
170 * Constant that represents the months field.
172 public static final Field MONTHS = new Field(2, "MONTHS");
175 * Constant that represents the days field.
177 public static final Field DAYS = new Field(3, "DAYS");
180 * Constant that represents the hours field.
182 public static final Field HOURS = new Field(4, "HOURS");
185 * Constant that represents the minutes field.
187 public static final Field MINUTES = new Field(5, "MINUTES");
190 * Constant that represents the seconds field.
192 public static final Field SECONDS = new Field(6, "SECONDS");
195 * The qualified-name for the <code>dateTime</code> data type.
197 public static final QName DATETIME = new QName ("http://www.w3.org/2001/XMLSchema#dateTime", "");
200 * The qualified-name for the <code>time</code> data type.
202 public static final QName TIME = new QName ("http://www.w3.org/2001/XMLSchema#time", "");
205 * The qualified-name for the <code>date</code> data type.
207 public static final QName DATE = new QName ("http://www.w3.org/2001/XMLSchema#date", "");
210 * The qualified-name for the <code>gYearMonth</code> data type.
212 public static final QName GYEARMONTH = new QName ("http://www.w3.org/2001/XMLSchema#gYearMonth", "");
215 * The qualified-name for the <code>gMonthDay</code> data type.
217 public static final QName GMONTHDAY = new QName ("http://www.w3.org/2001/XMLSchema#gMonthDay", "");
220 * The qualified-name for the <code>gYear</code> data type.
222 public static final QName GYEAR = new QName ("http://www.w3.org/2001/XMLSchema#gYear", "");
225 * The qualified-name for the <code>gMonth</code> data type.
227 public static final QName GMONTH = new QName ("http://www.w3.org/2001/XMLSchema#gMonth", "");
230 * The qualified-name for the <code>gDay</code> data type.
232 public static final QName GDAY = new QName ("http://www.w3.org/2001/XMLSchema#gDay", "");
235 * The qualified-name for the <code>duration</code> data type.
237 public static final QName DURATION = new QName ("http://www.w3.org/2001/XMLSchema#duration", "");
240 * The qualified-name for the <code>dayTimeDuration</code> data type.
242 public static final QName DURATION_DAYTIME = new QName ("http://www.w3.org/2001/XMLSchema#dayTimeDuration", "");
245 * The qualified-name for the <code>yearMonthDuration</code> data type.
247 public static final QName DURATION_YEARMONTH = new QName ("http://www.w3.org/2001/XMLSchema#yearMonthDuration", "");
250 * XML Schema maximum timezone offset, in minutes.
252 public static final int MAX_TIMEZONE_OFFSET = -840;
255 * XML Schema minimum timezone offset, in minutes.
257 public static final int MIN_TIMEZONE_OFFSET = 840;