Class BigDateTimeValueType

  • All Implemented Interfaces:
    IDateTimeValueType, java.io.Serializable

    public class BigDateTimeValueType
    extends java.lang.Object
    implements IDateTimeValueType
    DateTimeValueType object that can hold all lexically valid dateTime value. This class provides:
    1. Unlimited digits for year (e.g., "year 9999999999999999999999")
    2. Unlimited digits for fraction of second (e.g. 0.00000000000001 sec)
    To provide methods that can change date/time values, normalize method should be modified too.
    See Also:
    Serialized Form
    • Field Detail

      • year

        private java.math.BigInteger year
        year value. this variable is null if no year is specified. Since there is no year 0, value 0 indicates year -1. -1 indicates -2, and so forth.
      • month

        private java.lang.Integer month
        month (always between 0 and 11) this variable is null if no year is specified
      • day

        private java.lang.Integer day
        day (always normalized, between 0-30) this variable is null if no year is specified
      • hour

        private java.lang.Integer hour
        hour (always between 0 and 23) this variable is null if no year is specified
      • minute

        private java.lang.Integer minute
        minute (always between 0 and 59) this variable is null if no year is specified
      • second

        private java.math.BigDecimal second
        second (always in [0,60) ) this variable is null if no year is specified
      • zone

        private java.util.TimeZone zone
        time zone specifier. null if missing
      • normalizedValue

        private IDateTimeValueType normalizedValue
        normalized DateTimeValue of this object. once when the normalized value is computed, the value is kept in this varible so that successive calls to normalize method need not have to compute it again. This approach assumes that modification to the date/time component will never be made.
    • Constructor Detail

      • BigDateTimeValueType

        public BigDateTimeValueType​(BigDateTimeValueType base,
                                    java.util.TimeZone newTimeZone)
        creates an instance with the specified BigDateTimeValueType, with modified time zone. created object shares its date/time value component with the original one, so special care is necessary not to mutate those values.
      • BigDateTimeValueType

        public BigDateTimeValueType​(java.math.BigInteger year,
                                    int month,
                                    int day,
                                    int hour,
                                    int minute,
                                    java.math.BigDecimal second,
                                    java.util.TimeZone timeZone)
      • BigDateTimeValueType

        public BigDateTimeValueType​(java.math.BigInteger year,
                                    java.lang.Integer month,
                                    java.lang.Integer day,
                                    java.lang.Integer hour,
                                    java.lang.Integer minute,
                                    java.math.BigDecimal second,
                                    java.util.TimeZone timeZone)
      • BigDateTimeValueType

        public BigDateTimeValueType()
    • Method Detail

      • getYear

        public java.math.BigInteger getYear()
      • getMonth

        public java.lang.Integer getMonth()
      • getDay

        public java.lang.Integer getDay()
      • getHour

        public java.lang.Integer getHour()
      • getMinute

        public java.lang.Integer getMinute()
      • getSecond

        public java.math.BigDecimal getSecond()
      • getTimeZone

        public java.util.TimeZone getTimeZone()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        gets a human-readable representation of this object. return value is not intended to be compliant with the canonical representation of "dateTime" type.
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compare

        protected static int compare​(BigDateTimeValueType lhs,
                                     BigDateTimeValueType rhs)
        compares two BigDateTimeValueType and returns one of the constant defined in Comparator. Order-relation between two dateTime is defined in http://www.w3.org/TR/xmlschema-2/#dateTime
      • nullAs0

        private static java.math.BigInteger nullAs0​(java.math.BigInteger o)
      • nullAs0

        private static java.math.BigDecimal nullAs0​(java.math.BigDecimal o)
      • divideAndRemainder

        private static java.math.BigInteger[] divideAndRemainder​(java.math.BigInteger x1,
                                                                 java.math.BigInteger x2)
      • toCalendar

        public java.util.Calendar toCalendar()
        Description copied from interface: IDateTimeValueType
        Approximates the value represented by this object into a Calendar object. This conversion may lose accuracy.
        Specified by:
        toCalendar in interface IDateTimeValueType
      • createJavaTimeZone

        protected java.util.TimeZone createJavaTimeZone()
        Deprecated.
        Creates the equivalent Java TimeZone object.
        Returns:
        a non-null valid object.