Class BigTimeDurationValueType

    • Field Detail

      • signum

        protected int signum
      • year

        protected java.math.BigInteger year
      • month

        protected java.math.BigInteger month
      • day

        protected java.math.BigInteger day
      • hour

        protected java.math.BigInteger hour
      • minute

        protected java.math.BigInteger minute
      • second

        protected java.math.BigDecimal second
    • Constructor Detail

      • BigTimeDurationValueType

        public BigTimeDurationValueType​(int signum,
                                        java.math.BigInteger year,
                                        java.math.BigInteger month,
                                        java.math.BigInteger day,
                                        java.math.BigInteger hour,
                                        java.math.BigInteger minute,
                                        java.math.BigDecimal second)
        All the fields should be positive and use the signum field to determine the sign.
      • BigTimeDurationValueType

        public BigTimeDurationValueType​(java.lang.String lexicalRepresentation)
                                 throws java.lang.IllegalArgumentException
        Reads in the lexical duration format.
        Parameters:
        lexicalRepresentation - whitespace stripped lexical form.
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • equals

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • nullAsZero

        private java.math.BigInteger nullAsZero​(java.math.BigInteger o)
      • hashCode

        public int hashCode()
        hash code has to be consistent with equals method.
        Overrides:
        hashCode in class java.lang.Object
      • getDay

        public java.math.BigInteger getDay()
        Returns:
        non-null positive value. use signum for the sign.
      • getHour

        public java.math.BigInteger getHour()
        Returns:
        non-null positive value. use signum for the sign.
      • getMinute

        public java.math.BigInteger getMinute()
        Returns:
        non-null positive value. use signum for the sign.
      • getMonth

        public java.math.BigInteger getMonth()
        Returns:
        non-null positive value. use signum for the sign.
      • getSecond

        public java.math.BigDecimal getSecond()
        Returns:
        non-null positive value. use signum for the sign.
      • getYear

        public java.math.BigInteger getYear()
        Returns:
        non-null positive value. use signum for the sign.
      • getSignum

        private int getSignum​(java.math.BigInteger i)
      • getSignum

        private int getSignum​(java.math.BigDecimal i)
      • isDigit

        private static boolean isDigit​(char ch)
      • isDigitOrPeriod

        private static boolean isDigitOrPeriod​(char ch)
      • parsePiece

        private static java.lang.String parsePiece​(java.lang.String whole,
                                                   int[] idx)
                                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • organizeParts

        private static void organizeParts​(java.lang.String whole,
                                          java.lang.String[] parts,
                                          int[] partsIndex,
                                          int len,
                                          java.lang.String tokens)
                                   throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • parseBigInteger

        private static java.math.BigInteger parseBigInteger​(java.lang.String whole,
                                                            java.lang.String part,
                                                            int index)
                                                     throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • parseBigDecimal

        private static java.math.BigDecimal parseBigDecimal​(java.lang.String whole,
                                                            java.lang.String part,
                                                            int index)
                                                     throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • readObject

        private void readObject​(java.io.ObjectInputStream ois)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException