jaxp/src/java.xml/share/classes/javax/xml/datatype/XMLGregorianCalendar.java
author avstepan
Tue, 21 Apr 2015 20:01:21 +0400
changeset 29999 8493f5fc1052
parent 25868 686eef1e7a79
child 39904 113a518e3266
permissions -rw-r--r--
8077332: tidy warnings from javax/xml Summary: some HTML markup fix (jaxp part) Reviewed-by: joehw, lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     1
/*
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     2
 * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     4
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    10
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    15
 * accompanied this code).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    16
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    20
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    23
 * questions.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    24
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    25
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    26
package javax.xml.datatype;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    27
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    28
import javax.xml.namespace.QName;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    29
import java.math.BigDecimal;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    30
import java.math.BigInteger;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    31
import java.util.TimeZone;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    32
import java.util.GregorianCalendar;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    33
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    34
/**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    35
 * <p>Representation for W3C XML Schema 1.0 date/time datatypes.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    36
 * Specifically, these date/time datatypes are
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    37
 * {@link DatatypeConstants#DATETIME},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    38
 * {@link DatatypeConstants#TIME},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    39
 * {@link DatatypeConstants#DATE},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    40
 * {@link DatatypeConstants#GYEARMONTH},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    41
 * {@link DatatypeConstants#GMONTHDAY},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    42
 * {@link DatatypeConstants#GYEAR},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    43
 * {@link DatatypeConstants#GMONTH}, and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    44
 * {@link DatatypeConstants#GDAY}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    45
 * defined in the XML Namespace
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    46
 * {@code "http://www.w3.org/2001/XMLSchema"}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    47
 * These datatypes are normatively defined in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    48
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    49
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    50
 * <p>The table below defines the mapping between XML Schema 1.0
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    51
 * date/time datatype fields and this class' fields. It also summarizes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    52
 * the value constraints for the date and time fields defined in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    53
 * <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    54
 * <i>ISO 8601 Date and Time Formats</i></a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    55
 *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    56
 * <a name="datetimefieldmapping"></a>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    57
 * <table border="2" rules="all" cellpadding="2">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    58
 *   <thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    59
 *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    60
 *       <th align="center" colspan="3">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    61
 *         Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    62
 *       </th>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    63
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    64
 *   </thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    65
 *   <tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    66
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    67
 *       <th>XML Schema 1.0<br>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    68
 *           datatype<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    69
 *            field</th>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    70
 *       <th>Related<br>XMLGregorianCalendar<br>Accessor(s)</th>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    71
 *       <th>Value Range</th>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    72
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    73
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    74
 *       <td><a name="datetimefield-year">year</a></td>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    75
 *       <td> {@link #getYear()} + {@link #getEon()} or<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    76
 *            {@link #getEonAndYear}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    77
 *       </td>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    78
 *       <td> {@code getYear()} is a value between -(10^9-1) to (10^9)-1
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    79
 *            or {@link DatatypeConstants#FIELD_UNDEFINED}.<br>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    80
 *            {@link #getEon()} is high order year value in billion of years.<br>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    81
 *            {@code getEon()} has values greater than or equal to (10^9) or less than or equal to -(10^9).
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    82
 *            A value of null indicates field is undefined.<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    83
 *            Given that <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-63">XML Schema 1.0 errata</a> states that the year zero
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    84
 *            will be a valid lexical value in a future version of XML Schema,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    85
 *            this class allows the year field to be set to zero. Otherwise,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    86
 *            the year field value is handled exactly as described
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    87
 *            in the errata and [ISO-8601-1988]. Note that W3C XML Schema 1.0
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    88
 *            validation does not allow for the year field to have a value of zero.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    89
 *            </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    90
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    91
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    92
 *       <td><a name="datetimefield-month">month</a></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    93
 *       <td> {@link #getMonth()} </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    94
 *       <td> 1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    95
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    96
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    97
 *       <td><a name="datetimefield-day">day</a></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    98
 *       <td> {@link #getDay()} </td>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
    99
 *       <td> Independent of month, max range is 1 to 31 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   100
 *            The normative value constraint stated relative to month
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   101
 *            field's value is in <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   102
 *       </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   103
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   104
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   105
 *       <td><a name="datetimefield-hour">hour</a></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   106
 *       <td>{@link #getHour()}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   107
 *       <td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   108
 *         0 to 23 or {@link DatatypeConstants#FIELD_UNDEFINED}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   109
 *         An hour value of 24 is allowed to be set in the lexical space provided the minute and second
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   110
 *         field values are zero. However, an hour value of 24 is not allowed in value space and will be
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   111
 *         transformed to represent the value of the first instance of the following day as per
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   112
 *         <a href="http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   113
 *         XML Schema Part 2: Datatypes Second Edition, 3.2 Primitive datatypes</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   114
 *       </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   115
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   116
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   117
 *       <td><a name="datetimefield-minute">minute</a></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   118
 *       <td> {@link #getMinute()} </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   119
 *       <td> 0 to 59 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   120
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   121
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   122
 *       <td><a name="datetimefield-second">second</a></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   123
 *       <td>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   124
 *         {@link #getSecond()} + {@link #getMillisecond()}/1000 or<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   125
 *         {@link #getSecond()} + {@link #getFractionalSecond()}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   126
 *       </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   127
 *       <td>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   128
 *         {@link #getSecond()} from 0 to 60 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   129
 *         <i>(Note: 60 only allowable for leap second.)</i><br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   130
 *         {@link #getFractionalSecond()} allows for infinite precision over the range from 0.0 to 1.0 when
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   131
 *         the {@link #getSecond()} is defined.<br>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   132
 *         {@code FractionalSecond} is optional and has a value of {@code null} when it is undefined.<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   133
 *            {@link #getMillisecond()} is the convenience
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   134
 *            millisecond precision of value of {@link #getFractionalSecond()}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   135
 *       </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   136
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   137
 *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   138
 *       <td><a name="datetimefield-timezone">timezone</a></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   139
 *       <td> {@link #getTimezone()} </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   140
 *       <td> Number of minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   141
 *         Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   142
 *       </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   143
 *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   144
 *   </tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   145
 *  </table>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   146
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   147
 * <p>All maximum value space constraints listed for the fields in the table
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   148
 * above are checked by factory methods, {@link DatatypeFactory},
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   149
 * setter methods and parse methods of
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   150
 * this class. {@code IllegalArgumentException} is thrown when a
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   151
 * parameter's value is outside the value constraint for the field or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   152
 * if the composite
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   153
 * values constitute an invalid XMLGregorianCalendar instance (for example, if
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   154
 * the 31st of June is specified).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   155
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   156
 * <p>The following operations are defined for this class:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   157
 * <ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   158
 *   <li>accessors/mutators for independent date/time fields</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   159
 *   <li>conversion between this class and W3C XML Schema 1.0 lexical representation,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   160
 *     {@link #toString()}, {@link DatatypeFactory#newXMLGregorianCalendar(String lexicalRepresentation)}</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   161
 *   <li>conversion between this class and {@link GregorianCalendar},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   162
 *     {@link #toGregorianCalendar(java.util.TimeZone timezone, java.util.Locale aLocale, XMLGregorianCalendar defaults)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   163
 *     {@link DatatypeFactory}</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   164
 *   <li>partial order relation comparator method, {@link #compare(XMLGregorianCalendar xmlGregorianCalendar)}</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   165
 *   <li>{@link #equals(Object)} defined relative to {@link #compare(XMLGregorianCalendar xmlGregorianCalendar)}.</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   166
 *   <li>addition operation with {@link Duration}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   167
 *      instance as defined in <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   168
 *      W3C XML Schema 1.0 Part 2, Appendix E, <i>Adding durations to dateTimes</i></a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   169
 *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   170
 * </ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   171
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   172
 * @author <a href="mailto:Joseph.Fialli@Sun.com">Joseph Fialli</a>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   173
 * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   174
 * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   175
 * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   176
 * @see Duration
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   177
 * @see DatatypeFactory
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   178
 * @since 1.5
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   179
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   180
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   181
public abstract class XMLGregorianCalendar
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   182
        implements Cloneable {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   183
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   184
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   185
         * Default no-arg constructor.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   186
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   187
         * <p>Note: Always use the {@link DatatypeFactory} to
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   188
         * construct an instance of {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   189
         * The constructor on this class cannot be guaranteed to
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   190
         * produce an object with a consistent state and may be
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   191
         * removed in the future.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   192
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   193
         public XMLGregorianCalendar() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   194
         }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   195
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   196
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   197
         * Unset all fields to undefined.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   198
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   199
         * <p>Set all int fields to {@link DatatypeConstants#FIELD_UNDEFINED} and reference fields
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   200
         * to null.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   201
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   202
        public abstract void clear();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   203
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   204
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   205
         * Reset this {@code XMLGregorianCalendar} to its original values.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   206
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   207
         * <p>{@code XMLGregorianCalendar} is reset to the same values as when it was created with
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   208
         * {@link DatatypeFactory#newXMLGregorianCalendar()},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   209
         * {@link DatatypeFactory#newXMLGregorianCalendar(String lexicalRepresentation)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   210
         * {@link DatatypeFactory#newXMLGregorianCalendar(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   211
         *   BigInteger year,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   212
         *   int month,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   213
         *   int day,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   214
         *   int hour,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   215
         *   int minute,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   216
         *   int second,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   217
         *   BigDecimal fractionalSecond,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   218
         *   int timezone)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   219
         * {@link DatatypeFactory#newXMLGregorianCalendar(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   220
         *   int year,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   221
         *   int month,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   222
         *   int day,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   223
         *   int hour,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   224
         *   int minute,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   225
         *   int second,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   226
         *   int millisecond,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   227
         *   int timezone)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   228
         * {@link DatatypeFactory#newXMLGregorianCalendar(GregorianCalendar cal)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   229
         * {@link DatatypeFactory#newXMLGregorianCalendarDate(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   230
         *   int year,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   231
         *   int month,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   232
         *   int day,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   233
         *   int timezone)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   234
         * {@link DatatypeFactory#newXMLGregorianCalendarTime(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   235
         *   int hours,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   236
         *   int minutes,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   237
         *   int seconds,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   238
         *   int timezone)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   239
         * {@link DatatypeFactory#newXMLGregorianCalendarTime(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   240
         *   int hours,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   241
         *   int minutes,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   242
         *   int seconds,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   243
         *   BigDecimal fractionalSecond,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   244
         *   int timezone)} or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   245
         * {@link DatatypeFactory#newXMLGregorianCalendarTime(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   246
         *   int hours,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   247
         *   int minutes,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   248
         *   int seconds,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   249
         *   int milliseconds,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   250
         *   int timezone)}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   251
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   252
         * <p>{@code reset()} is designed to allow the reuse of existing {@code XMLGregorianCalendar}s
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   253
         * thus saving resources associated with the creation of new {@code XMLGregorianCalendar}s.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   254
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   255
        public abstract void reset();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   256
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   257
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   258
     * Set low and high order component of XSD {@code dateTime} year field.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   259
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   260
     * <p>Unset this field by invoking the setter with a parameter value of {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   261
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   262
     * @param year value constraints summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   263
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   264
     * @throws IllegalArgumentException if {@code year} parameter is
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   265
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   266
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   267
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   268
    public abstract void setYear(BigInteger year);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   269
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   270
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   271
     * Set year of XSD {@code dateTime} year field.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   272
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   273
     * <p>Unset this field by invoking the setter with a parameter value of
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   274
     * {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   275
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   276
     * <p>Note: if the absolute value of the {@code year} parameter
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   277
     * is less than 10^9, the eon component of the XSD year field is set to
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   278
     * {@code null} by this method.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   279
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   280
     * @param year value constraints are summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   281
     *   If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   282
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   283
    public abstract void setYear(int year);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   284
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   285
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   286
     * Set month.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   287
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   288
     * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   289
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   290
     * @param month value constraints summarized in <a href="#datetimefield-month">month field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   291
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   292
     * @throws IllegalArgumentException if {@code month} parameter is
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   293
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   294
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   295
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   296
    public abstract void setMonth(int month);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   297
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   298
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   299
     * Set days in month.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   300
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   301
     * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   302
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   303
     * @param day value constraints summarized in <a href="#datetimefield-day">day field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   304
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   305
     * @throws IllegalArgumentException if {@code day} parameter is
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   306
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   307
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   308
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   309
    public abstract void setDay(int day);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   310
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   311
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   312
     * Set the number of minutes in the timezone offset.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   313
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   314
     * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   315
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   316
     * @param offset value constraints summarized in <a href="#datetimefield-timezone">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   317
     *   timezone field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   318
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   319
     * @throws IllegalArgumentException if {@code offset} parameter is
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   320
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   321
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   322
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   323
    public abstract void setTimezone(int offset);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   324
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   325
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   326
     * Set time as one unit.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   327
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   328
     * @param hour value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   329
     * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   330
     * @param minute value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   331
     * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   332
     * @param second value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   333
     * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   334
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   335
     * @see #setTime(int, int, int, BigDecimal)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   336
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   337
     * @throws IllegalArgumentException if any parameter is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   338
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   339
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   340
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   341
    public void setTime(int hour, int minute, int second) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   342
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   343
                setTime(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   344
                        hour,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   345
                        minute,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   346
                        second,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   347
                        null // fractional
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   348
                );
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   349
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   350
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   351
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   352
         * Set hours.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   353
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   354
         * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   355
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   356
         * @param hour value constraints summarized in <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   357
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   358
         * @throws IllegalArgumentException if {@code hour} parameter is outside value constraints for the field as specified in
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   359
         *   <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   360
        */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   361
        public abstract void setHour(int hour);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   362
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   363
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   364
         * Set minutes.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   365
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   366
         * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   367
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   368
         * @param minute value constraints summarized in <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   369
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   370
         * @throws IllegalArgumentException if {@code minute} parameter is outside value constraints for the field as specified in
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   371
         *   <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   372
        */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   373
        public abstract void setMinute(int minute);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   374
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   375
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   376
         * Set seconds.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   377
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   378
         * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   379
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   380
         * @param second value constraints summarized in <a href="#datetimefield-second">second field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   381
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   382
         * @throws IllegalArgumentException if {@code second} parameter is outside value constraints for the field as specified in
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   383
         *   <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   384
        */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   385
        public abstract void setSecond(int second);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   386
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   387
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   388
         * Set milliseconds.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   389
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   390
         * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   391
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   392
         * @param millisecond value constraints summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   393
         *   <a href="#datetimefield-second">second field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   394
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   395
         * @throws IllegalArgumentException if {@code millisecond} parameter is outside value constraints for the field as specified
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   396
         *   in <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   397
        */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   398
        public abstract void setMillisecond(int millisecond);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   399
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   400
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   401
         * Set fractional seconds.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   402
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   403
         * <p>Unset this field by invoking the setter with a parameter value of {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   404
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   405
         * @param fractional value constraints summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   406
         *   <a href="#datetimefield-second">second field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   407
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   408
         * @throws IllegalArgumentException if {@code fractional} parameter is outside value constraints for the field as specified
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   409
         *   in <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   410
        */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   411
        public abstract void setFractionalSecond(BigDecimal fractional);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   412
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   413
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   414
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   415
     * Set time as one unit, including the optional infinite precision
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   416
     * fractional seconds.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   417
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   418
     * @param hour value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   419
     * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   420
     * @param minute value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   421
     * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   422
     * @param second value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   423
     * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   424
     * @param fractional value of {@code null} indicates this optional
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   425
     *   field is not set.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   426
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   427
     * @throws IllegalArgumentException if any parameter is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   428
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   429
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   430
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   431
    public void setTime(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   432
        int hour,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   433
        int minute,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   434
        int second,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   435
        BigDecimal fractional) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   436
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   437
                setHour(hour);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   438
        setMinute(minute);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   439
        setSecond(second);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   440
        setFractionalSecond(fractional);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   441
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   442
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   443
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   444
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   445
     * Set time as one unit, including optional milliseconds.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   446
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   447
     * @param hour value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   448
     * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   449
     * @param minute value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   450
     * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   451
     * @param second value constraints are summarized in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   452
     * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   453
     * @param millisecond value of {@link DatatypeConstants#FIELD_UNDEFINED} indicates this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   454
     *                    optional field is not set.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   455
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   456
     * @throws IllegalArgumentException if any parameter is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   457
     * outside value constraints for the field as specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   458
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   459
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   460
    public void setTime(int hour, int minute, int second, int millisecond) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   461
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   462
        setHour(hour);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   463
        setMinute(minute);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   464
        setSecond(second);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   465
        setMillisecond(millisecond);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   466
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   467
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   468
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   469
         * Return high order component for XML Schema 1.0 dateTime datatype field for
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   470
         * {@code year}.
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   471
         * {@code null} if this optional part of the year field is not defined.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   472
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   473
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   474
         * <a href="#datetimefield-year">year field of date/time field mapping table</a>.
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   475
         * @return eon of this {@code XMLGregorianCalendar}. The value
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   476
         * returned is an integer multiple of 10^9.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   477
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   478
         * @see #getYear()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   479
         * @see #getEonAndYear()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   480
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   481
        public abstract BigInteger getEon();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   482
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   483
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   484
         * Return low order component for XML Schema 1.0 dateTime datatype field for
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   485
         * {@code year} or {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   486
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   487
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   488
         * <a href="#datetimefield-year">year field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   489
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   490
         * @return year  of this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   491
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   492
         * @see #getEon()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   493
         * @see #getEonAndYear()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   494
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   495
        public abstract int getYear();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   496
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   497
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   498
         * Return XML Schema 1.0 dateTime datatype field for
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   499
         * {@code year}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   500
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   501
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   502
         * <a href="#datetimefield-year">year field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   503
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   504
         * @return sum of {@code eon} and {@code BigInteger.valueOf(year)}
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   505
         * when both fields are defined. When only {@code year} is defined,
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   506
         * return it. When both {@code eon} and {@code year} are not
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   507
         * defined, return {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   508
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   509
         * @see #getEon()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   510
         * @see #getYear()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   511
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   512
        public abstract BigInteger getEonAndYear();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   513
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   514
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   515
         * Return number of month or {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   516
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   517
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   518
         * <a href="#datetimefield-month">month field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   519
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   520
         * @return year  of this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   521
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   522
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   523
        public abstract int getMonth();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   524
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   525
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   526
         * Return day in month or {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   527
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   528
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   529
         * <a href="#datetimefield-day">day field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   530
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   531
         * @see #setDay(int)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   532
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   533
        public abstract int getDay();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   534
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   535
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   536
         * Return timezone offset in minutes or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   537
         * {@link DatatypeConstants#FIELD_UNDEFINED} if this optional field is not defined.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   538
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   539
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   540
         * <a href="#datetimefield-timezone">timezone field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   541
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   542
         * @see #setTimezone(int)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   543
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   544
        public abstract int getTimezone();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   545
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   546
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   547
         * Return hours or {@link DatatypeConstants#FIELD_UNDEFINED}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   548
         * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   549
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   550
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   551
         * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   552
         * @see #setTime(int, int, int)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   553
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   554
        public abstract int getHour();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   555
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   556
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   557
         * Return minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   558
         * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   559
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   560
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   561
         * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   562
         * @see #setTime(int, int, int)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   563
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   564
        public abstract int getMinute();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   565
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   566
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   567
         * Return seconds or {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   568
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   569
         * <p>Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   570
         * When this field is not defined, the optional xs:dateTime
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   571
         * fractional seconds field, represented by
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   572
         * {@link #getFractionalSecond()} and {@link #getMillisecond()},
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   573
         * must not be defined.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   574
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   575
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   576
         * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   577
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   578
         * @return Second  of this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   579
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   580
         * @see #getFractionalSecond()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   581
         * @see #getMillisecond()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   582
         * @see #setTime(int, int, int)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   583
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   584
        public abstract int getSecond();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   585
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   586
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   587
         * Return millisecond precision of {@link #getFractionalSecond()}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   588
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   589
         * <p>This method represents a convenience accessor to infinite
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   590
         * precision fractional second value returned by
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   591
         * {@link #getFractionalSecond()}. The returned value is the rounded
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   592
         * down to milliseconds value of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   593
         * {@link #getFractionalSecond()}. When {@link #getFractionalSecond()}
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   594
         * returns {@code null}, this method must return
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   595
         * {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   596
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   597
         * <p>Value constraints for this value are summarized in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   598
         * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   599
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   600
         * @return Millisecond  of this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   601
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   602
         * @see #getFractionalSecond()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   603
         * @see #setTime(int, int, int)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   604
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   605
        public int getMillisecond() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   606
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   607
                BigDecimal fractionalSeconds = getFractionalSecond();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   608
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   609
                // is field undefined?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   610
                if (fractionalSeconds == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   611
                        return DatatypeConstants.FIELD_UNDEFINED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   612
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   613
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   614
                return getFractionalSecond().movePointRight(3).intValue();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   615
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   616
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   617
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   618
         * Return fractional seconds.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   619
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   620
         * <p>{@code null} is returned when this optional field is not defined.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   621
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   622
         * <p>Value constraints are detailed in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   623
         * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   624
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   625
         * <p>This optional field can only have a defined value when the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   626
         * xs:dateTime second field, represented by {@link #getSecond()},
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   627
         * does not return {@link DatatypeConstants#FIELD_UNDEFINED}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   628
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   629
         * @return fractional seconds  of this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   630
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   631
         * @see #getSecond()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   632
         * @see #setTime(int, int, int, BigDecimal)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   633
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   634
        public abstract BigDecimal getFractionalSecond();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   635
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   636
    // comparisons
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   637
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   638
     * Compare two instances of W3C XML Schema 1.0 date/time datatypes
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   639
     * according to partial order relation defined in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   640
     * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.3,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   641
     * <i>Order relation on dateTime</i></a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   642
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   643
     * <p>{@code xsd:dateTime} datatype field mapping to accessors of
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   644
     * this class are defined in
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   645
     * <a href="#datetimefieldmapping">date/time field mapping table</a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   646
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   647
     * @param xmlGregorianCalendar Instance of {@code XMLGregorianCalendar} to compare
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   648
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   649
     * @return The relationship between {@code this} {@code XMLGregorianCalendar} and
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   650
     *   the specified {@code xmlGregorianCalendar} as
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   651
     *   {@link DatatypeConstants#LESSER},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   652
     *   {@link DatatypeConstants#EQUAL},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   653
     *   {@link DatatypeConstants#GREATER} or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   654
     *   {@link DatatypeConstants#INDETERMINATE}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   655
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   656
     * @throws NullPointerException if {@code xmlGregorianCalendar} is null.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   657
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   658
    public abstract int compare(XMLGregorianCalendar xmlGregorianCalendar);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   659
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   660
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   661
     * Normalize this instance to UTC.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   662
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   663
     * <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   664
     * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   665
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   666
     * @return {@code this} {@code XMLGregorianCalendar} normalized to UTC.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   667
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   668
    public abstract XMLGregorianCalendar normalize();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   669
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   670
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   671
     * Compares this calendar to the specified object. The result is
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   672
     * {@code true} if and only if the argument is not null and is an
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   673
     * {@code XMLGregorianCalendar} object that represents the same
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   674
     * instant in time as this object.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   675
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   676
     * @param obj to compare.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   677
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   678
     * @return {@code true} when {@code obj} is an instance of
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   679
     * {@code XMLGregorianCalendar} and
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   680
     * {@link #compare(XMLGregorianCalendar obj)}
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   681
     * returns {@link DatatypeConstants#EQUAL},
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   682
     * otherwise {@code false}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   683
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   684
    public boolean equals(Object obj) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   685
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   686
        if (obj == null || !(obj instanceof XMLGregorianCalendar)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   687
               return false;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   688
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   689
        return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   690
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   691
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   692
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   693
     * Returns a hash code consistent with the definition of the equals method.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   694
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   695
     * @return hash code of this object.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   696
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   697
    public int hashCode() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   698
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   699
        // Following two dates compare to EQUALS since in different timezones.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   700
        // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   701
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   702
        // Must ensure both instances generate same hashcode by normalizing
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   703
        // this to UTC timezone.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   704
        int timezone = getTimezone();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   705
        if (timezone == DatatypeConstants.FIELD_UNDEFINED) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   706
            timezone = 0;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   707
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   708
        XMLGregorianCalendar gc = this;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   709
        if (timezone != 0) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   710
            gc = this.normalize();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   711
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   712
        return gc.getYear()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   713
                + gc.getMonth()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   714
                + gc.getDay()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   715
                + gc.getHour()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   716
                + gc.getMinute()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   717
                + gc.getSecond();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   718
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   719
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   720
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   721
     * Return the lexical representation of {@code this} instance.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   722
     * The format is specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   723
     * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   724
     * <i>Lexical Representation</i>".</a>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   725
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   726
     * <p>Specific target lexical representation format is determined by
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   727
     * {@link #getXMLSchemaType()}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   728
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   729
     * @return XML, as {@code String}, representation of this {@code XMLGregorianCalendar}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   730
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   731
     * @throws IllegalStateException if the combination of set fields
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   732
     *    does not match one of the eight defined XML Schema builtin date/time datatypes.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   733
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   734
    public abstract String toXMLFormat();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   735
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   736
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   737
     * Return the name of the XML Schema date/time type that this instance
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   738
     * maps to. Type is computed based on fields that are set.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   739
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   740
     * <table border="2" rules="all" cellpadding="2">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   741
     *   <thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   742
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   743
     *       <th align="center" colspan="7">
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   744
     *         Required fields for XML Schema 1.0 Date/Time Datatypes.<br>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   745
     *         <i>(timezone is optional for all date/time datatypes)</i>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   746
     *       </th>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   747
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   748
     *   </thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   749
     *   <tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   750
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   751
     *       <td>Datatype</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   752
     *       <td>year</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   753
     *       <td>month</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   754
     *       <td>day</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   755
     *       <td>hour</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   756
     *       <td>minute</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   757
     *       <td>second</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   758
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   759
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   760
     *       <td>{@link DatatypeConstants#DATETIME}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   761
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   762
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   763
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   764
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   765
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   766
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   767
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   768
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   769
     *       <td>{@link DatatypeConstants#DATE}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   770
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   771
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   772
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   773
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   774
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   775
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   776
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   777
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   778
     *       <td>{@link DatatypeConstants#TIME}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   779
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   780
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   781
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   782
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   783
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   784
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   785
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   786
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   787
     *       <td>{@link DatatypeConstants#GYEARMONTH}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   788
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   789
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   790
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   791
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   792
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   793
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   794
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   795
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   796
     *       <td>{@link DatatypeConstants#GMONTHDAY}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   797
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   798
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   799
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   800
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   801
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   802
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   803
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   804
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   805
     *       <td>{@link DatatypeConstants#GYEAR}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   806
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   807
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   808
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   809
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   810
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   811
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   812
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   813
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   814
     *       <td>{@link DatatypeConstants#GMONTH}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   815
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   816
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   817
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   818
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   819
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   820
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   821
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   822
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   823
     *       <td>{@link DatatypeConstants#GDAY}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   824
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   825
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   826
     *       <td>X</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   827
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   828
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   829
     *       <td></td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   830
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   831
     *   </tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   832
     * </table>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   833
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   834
     * @throws java.lang.IllegalStateException if the combination of set fields
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   835
     *    does not match one of the eight defined XML Schema builtin
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   836
     *    date/time datatypes.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   837
     * @return One of the following class constants:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   838
     *   {@link DatatypeConstants#DATETIME},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   839
     *   {@link DatatypeConstants#TIME},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   840
     *   {@link DatatypeConstants#DATE},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   841
     *   {@link DatatypeConstants#GYEARMONTH},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   842
     *   {@link DatatypeConstants#GMONTHDAY},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   843
     *   {@link DatatypeConstants#GYEAR},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   844
     *   {@link DatatypeConstants#GMONTH} or
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   845
     *   {@link DatatypeConstants#GDAY}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   846
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   847
    public abstract QName getXMLSchemaType();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   848
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   849
        /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   850
         * Returns a {@code String} representation of this {@code XMLGregorianCalendar} {@code Object}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   851
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   852
         * <p>The result is a lexical representation generated by {@link #toXMLFormat()}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   853
         *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   854
         * @return A non-{@code null} valid {@code String} representation of this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   855
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   856
     * @throws IllegalStateException if the combination of set fields
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   857
     *    does not match one of the eight defined XML Schema builtin date/time datatypes.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   858
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   859
     * @see #toXMLFormat()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   860
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   861
    public String toString() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   862
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   863
        return toXMLFormat();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   864
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   865
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   866
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   867
     * Validate instance by {@code getXMLSchemaType()} constraints.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   868
     * @return true if data values are valid.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   869
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   870
    public abstract boolean isValid();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   871
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   872
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   873
     * Add {@code duration} to this instance.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   874
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   875
     * <p>The computation is specified in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   876
     * <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes">XML Schema 1.0 Part 2, Appendix E,
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   877
     * <i>Adding durations to dateTimes</i></a>.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   878
     * <a href="#datetimefieldmapping">date/time field mapping table</a>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   879
     * defines the mapping from XML Schema 1.0 {@code dateTime} fields
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   880
     * to this class' representation of those fields.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   881
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   882
     * @param duration Duration to add to this {@code XMLGregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   883
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   884
     * @throws NullPointerException  when {@code duration} parameter is {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   885
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   886
    public abstract void add(Duration duration);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   887
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   888
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   889
     * Convert this {@code XMLGregorianCalendar} to a {@link GregorianCalendar}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   890
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   891
     * <p>When {@code this} instance has an undefined field, this
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   892
     * conversion relies on the {@code java.util.GregorianCalendar} default
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   893
     * for its corresponding field. A notable difference between
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   894
     * XML Schema 1.0 date/time datatypes and {@code java.util.GregorianCalendar}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   895
     * is that Timezone value is optional for date/time datatypes and it is
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   896
     * a required field for {@code java.util.GregorianCalendar}. See javadoc
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   897
     * for {@code java.util.TimeZone.getDefault()} on how the default
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   898
     * is determined. To explicitly specify the {@code TimeZone}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   899
     * instance, see
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   900
     * {@link #toGregorianCalendar(TimeZone, Locale, XMLGregorianCalendar)}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   901
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   902
     * <table border="2" rules="all" cellpadding="2">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   903
     *   <thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   904
     *     <tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   905
     *       <th align="center" colspan="2">
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   906
     *          Field by Field Conversion from this class to
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   907
     *          {@code java.util.GregorianCalendar}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   908
     *       </th>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   909
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   910
     *   </thead>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   911
     *   <tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   912
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   913
     *        <td>{@code java.util.GregorianCalendar} field</td>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   914
     *        <td>{@code javax.xml.datatype.XMLGregorianCalendar} field</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   915
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   916
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   917
     *       <td>{@code ERA}</td>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   918
     *       <td>{@link #getEonAndYear()}{@code .signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   919
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   920
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   921
     *       <td>{@code YEAR}</td>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   922
     *       <td>{@link #getEonAndYear()}{@code .abs().intValue()}<i>*</i></td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   923
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   924
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   925
     *       <td>{@code MONTH}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   926
     *       <td>{@link #getMonth()} - {@link DatatypeConstants#JANUARY} + {@link GregorianCalendar#JANUARY}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   927
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   928
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   929
     *       <td>{@code DAY_OF_MONTH}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   930
     *       <td>{@link #getDay()}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   931
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   932
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   933
     *       <td>{@code HOUR_OF_DAY}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   934
     *       <td>{@link #getHour()}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   935
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   936
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   937
     *       <td>{@code MINUTE}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   938
     *       <td>{@link #getMinute()}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   939
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   940
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   941
     *       <td>{@code SECOND}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   942
     *       <td>{@link #getSecond()}</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   943
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   944
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   945
     *       <td>{@code MILLISECOND}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   946
     *       <td>get millisecond order from {@link #getFractionalSecond()}<i>*</i> </td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   947
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   948
     *     <tr>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   949
     *       <td>{@code GregorianCalendar.setTimeZone(TimeZone)}</td>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   950
     *       <td>{@link #getTimezone()} formatted into Custom timezone id</td>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   951
     *     </tr>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   952
     *   </tbody>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   953
     * </table>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   954
     * <i>*</i> designates possible loss of precision during the conversion due
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   955
     * to source datatype having higher precision than target datatype.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   956
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   957
     * <p>To ensure consistency in conversion implementations, the new
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   958
     * {@code GregorianCalendar} should be instantiated in following
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   959
     * manner.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   960
     * <ul>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   961
     *   <li>Using {@code timeZone} value as defined above, create a new
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   962
     * {@code java.util.GregorianCalendar(timeZone,Locale.getDefault())}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   963
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   964
     *   <li>Initialize all GregorianCalendar fields by calling {@link java.util.GregorianCalendar#clear()}.</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   965
     *   <li>Obtain a pure Gregorian Calendar by invoking
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   966
     *   {@code GregorianCalendar.setGregorianChange(
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   967
     *   new Date(Long.MIN_VALUE))}.</li>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   968
     *   <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   969
     *       MINUTE, SECOND and MILLISECOND are set using the method
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   970
     *       {@code Calendar.set(int,int)}</li>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   971
     * </ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   972
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   973
     * @see #toGregorianCalendar(java.util.TimeZone, java.util.Locale, XMLGregorianCalendar)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   974
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   975
    public abstract GregorianCalendar toGregorianCalendar();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   976
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   977
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   978
     * Convert this {@code XMLGregorianCalendar} along with provided parameters
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   979
     * to a {@link GregorianCalendar} instance.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   980
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   981
     * <p> Since XML Schema 1.0 date/time datetypes has no concept of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   982
     * timezone ids or daylight savings timezone ids, this conversion operation
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   983
     * allows the user to explicitly specify one with
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   984
     * {@code timezone} parameter.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   985
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   986
     * <p>To compute the return value's {@code TimeZone} field,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   987
     * <ul>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   988
     * <li>when parameter {@code timeZone} is non-null,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   989
     * it is the timezone field.</li>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   990
     * <li>else when {@code this.getTimezone() != FIELD_UNDEFINED},
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   991
     * create a {@code java.util.TimeZone} with a custom timezone id
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   992
     * using the {@code this.getTimezone()}.</li>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   993
     * <li>else when {@code defaults.getTimezone() != FIELD_UNDEFINED},
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   994
     * create a {@code java.util.TimeZone} with a custom timezone id
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   995
     * using {@code defaults.getTimezone()}.</li>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   996
     * <li>else use the {@code GregorianCalendar} default timezone value
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   997
     * for the host is defined as specified by
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   998
     * {@code java.util.TimeZone.getDefault()}.</li>
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
   999
     * </ul>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1000
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1001
     * <p>To ensure consistency in conversion implementations, the new
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1002
     * {@code GregorianCalendar} should be instantiated in following
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1003
     * manner.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1004
     * <ul>
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1005
     *   <li>Create a new {@code java.util.GregorianCalendar(TimeZone,
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1006
     *       Locale)} with TimeZone set as specified above and the
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1007
     *       {@code Locale} parameter.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1008
     *   </li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1009
     *   <li>Initialize all GregorianCalendar fields by calling {@link GregorianCalendar#clear()}</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1010
     *   <li>Obtain a pure Gregorian Calendar by invoking
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1011
     *   {@code GregorianCalendar.setGregorianChange(
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1012
     *   new Date(Long.MIN_VALUE))}.</li>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1013
     *   <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1014
     *       MINUTE, SECOND and MILLISECOND are set using the method
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1015
     *       {@code Calendar.set(int,int)}</li>
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1016
     * </ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1017
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1018
     * @param timezone provide Timezone. {@code null} is a legal value.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1019
     * @param aLocale  provide explicit Locale. Use default GregorianCalendar locale if
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1020
     *                 value is {@code null}.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1021
     * @param defaults provide default field values to use when corresponding
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1022
     *                 field for this instance is FIELD_UNDEFINED or null.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1023
     *                 If {@code defaults}is {@code null} or a field
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1024
     *                 within the specified {@code defaults} is undefined,
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1025
     *                 just use {@code java.util.GregorianCalendar} defaults.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1026
     * @return a java.util.GregorianCalendar conversion of this instance.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1027
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1028
    public abstract GregorianCalendar toGregorianCalendar(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1029
        java.util.TimeZone timezone,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1030
                java.util.Locale aLocale,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1031
                XMLGregorianCalendar defaults);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1032
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1033
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1034
     * Returns a {@code java.util.TimeZone} for this class.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1035
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1036
     * <p>If timezone field is defined for this instance,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1037
     * returns TimeZone initialized with custom timezone id
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1038
     * of zoneoffset. If timezone field is undefined,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1039
     * try the defaultZoneoffset that was passed in.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1040
     * If defaultZoneoffset is FIELD_UNDEFINED, return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1041
     * default timezone for this host.
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1042
     * (Same default as java.util.GregorianCalendar).
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1043
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1044
     * @param defaultZoneoffset default zoneoffset if this zoneoffset is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1045
     * {@link DatatypeConstants#FIELD_UNDEFINED}.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1046
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1047
     * @return TimeZone for this.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1048
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1049
    public abstract TimeZone getTimeZone(int defaultZoneoffset);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1050
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1051
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1052
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1053
    /**
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1054
     * Creates and returns a copy of this object.
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1055
     *
29999
8493f5fc1052 8077332: tidy warnings from javax/xml
avstepan
parents: 25868
diff changeset
  1056
     * @return copy of this {@code Object}
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1057
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1058
   public abstract Object clone();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1059
}