23 * questions.
24 */
25
26 package com.sun.org.apache.xerces.internal.jaxp.datatype;
27
28 import java.math.BigInteger;
29 import javax.xml.datatype.DatatypeConstants;
30
31
32 /**
33 * <p>Represent a subtype <code>xdt:yearMonthDuration</code> of a <code>Duration</code>
34 * as specified in <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
35 * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
36 *
37 *
38 * <p>The DurationYearMonth object represents a period of Gregorian time,
39 * with a lexical representation, "<em>PnYnM</em>" that contains only year and month components.
40 * </p>
41 *
42 *
43 * @author <a href="mailto:Vikram.Aroskar@Sun.COM">Vikram Aroskar</a>
44 * @author <a href="mailto:Huizhe.wang@oracle.com">Joe Wang</a>
45
46 * @see XMLGregorianCalendar#add(Duration)
47 */
48
49 class DurationYearMonthImpl
50 extends DurationImpl {
51 private static final long serialVersionUID = -4430140662861507958L;
52
53 /**
54 * <p>Constructs a new Duration object by specifying each field individually.</p>
55 *
56 * <p>All the parameters are optional as long as at least one field is present.
57 * If specified, parameters have to be zero or positive.</p>
58 *
59 * @param isPositive Set to <code>false</code> to create a negative duration. When the length
60 * of the duration is zero, this parameter will be ignored.
61 * @param years of this <code>Duration</code>
62 * @param months of this <code>Duration</code>
63 *
64 * @throws IllegalArgumentException
65 * If years, months parameters are all <code>null</code>. Or if any
|
23 * questions.
24 */
25
26 package com.sun.org.apache.xerces.internal.jaxp.datatype;
27
28 import java.math.BigInteger;
29 import javax.xml.datatype.DatatypeConstants;
30
31
32 /**
33 * <p>Represent a subtype <code>xdt:yearMonthDuration</code> of a <code>Duration</code>
34 * as specified in <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
35 * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
36 *
37 *
38 * <p>The DurationYearMonth object represents a period of Gregorian time,
39 * with a lexical representation, "<em>PnYnM</em>" that contains only year and month components.
40 * </p>
41 *
42 *
43 * @author Vikram Aroskar
44 * @see XMLGregorianCalendar#add(Duration)
45 */
46
47 class DurationYearMonthImpl
48 extends DurationImpl {
49 private static final long serialVersionUID = -4430140662861507958L;
50
51 /**
52 * <p>Constructs a new Duration object by specifying each field individually.</p>
53 *
54 * <p>All the parameters are optional as long as at least one field is present.
55 * If specified, parameters have to be zero or positive.</p>
56 *
57 * @param isPositive Set to <code>false</code> to create a negative duration. When the length
58 * of the duration is zero, this parameter will be ignored.
59 * @param years of this <code>Duration</code>
60 * @param months of this <code>Duration</code>
61 *
62 * @throws IllegalArgumentException
63 * If years, months parameters are all <code>null</code>. Or if any
|