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 * @version $Revision: 1.1 $, $Date: 2010/05/19 05:02:55 $
46
47 * @see XMLGregorianCalendar#add(Duration)
48 */
49
50 class DurationYearMonthImpl
51 extends DurationImpl {
52
53
54 /**
55 * <p>Constructs a new Duration object by specifying each field individually.</p>
56 *
57 * <p>All the parameters are optional as long as at least one field is present.
58 * If specified, parameters have to be zero or positive.</p>
59 *
60 * @param isPositive Set to <code>false</code> to create a negative duration. When the length
61 * of the duration is zero, this parameter will be ignored.
62 * @param years of this <code>Duration</code>
63 * @param months of this <code>Duration</code>
64 *
65 * @throws IllegalArgumentException
|
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
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
|