001/* DatatypeConstants.java --
002   Copyright (C) 2004, 2005, 2006  Free Software Foundation, Inc.
003
004This file is part of GNU Classpath.
005
006GNU Classpath is free software; you can redistribute it and/or modify
007it under the terms of the GNU General Public License as published by
008the Free Software Foundation; either version 2, or (at your option)
009any later version.
010
011GNU Classpath is distributed in the hope that it will be useful, but
012WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014General Public License for more details.
015
016You should have received a copy of the GNU General Public License
017along with GNU Classpath; see the file COPYING.  If not, write to the
018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
01902110-1301 USA.
020
021Linking this library statically or dynamically with other modules is
022making a combined work based on this library.  Thus, the terms and
023conditions of the GNU General Public License cover the whole
024combination.
025
026As a special exception, the copyright holders of this library give you
027permission to link this library with independent modules to produce an
028executable, regardless of the license terms of these independent
029modules, and to copy and distribute the resulting executable under
030terms of your choice, provided that you also meet, for each linked
031independent module, the terms and conditions of the license of that
032module.  An independent module is a module which is not derived from
033or based on this library.  If you modify this library, you may extend
034this exception to your version of the library, but you are not
035obligated to do so.  If you do not wish to do so, delete this
036exception statement from your version. */
037
038package javax.xml.datatype;
039
040import javax.xml.namespace.QName;
041
042/**
043 * Basic data type constants.
044 *
045 * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
046 * @since 1.5
047 */
048public final class DatatypeConstants
049{
050
051  private DatatypeConstants()
052  {
053    // to prevent instantiation
054  }
055
056  /**
057   * Typesafe enumerated class representing the six fields of the
058   * <a href='Duration.html'>Duration</a> class.
059   */
060  public static final class Field
061  {
062
063    final int id;
064    final String name;
065
066    Field(int id, String name)
067    {
068      this.id = id;
069      this.name = name;
070    }
071
072    public int getId()
073    {
074      return id;
075    }
076
077    public String toString()
078    {
079      return name;
080    }
081
082  }
083
084  /**
085   * Value for January.
086   */
087  public static final int JANUARY = 1;
088
089  /**
090   * Value for February.
091   */
092  public static final int FEBRUARY = 2;
093
094  /**
095   * Value for March.
096   */
097  public static final int MARCH = 3;
098
099  /**
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}