Class XSDDuration

  • All Implemented Interfaces:
    java.lang.Comparable<AbstractDateTime>

    public class XSDDuration
    extends AbstractDateTime
    Represent an XSD duration value. We use a seven dimensional space with years, months, days, hours, minutes, seconds and fractional seconds. This deviates from the spec which allows arbitrary position decimals for seconds.
    • Constructor Summary

      Constructors 
      Constructor Description
      XSDDuration​(java.lang.Object value)
      Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Equality function (value based).
      java.math.BigDecimal getBigSeconds()
      Return the number of seconds in the duration, including the fractional part, in a lossless but expensive notation - i.e.
      int getDays()
      Return the number of years in the duration
      int getFullSeconds()
      Return the number of full seconds in the duration
      int getHours()
      Return the number of hours in the duration
      int getMinutes()
      Return the number of minutes in the duration
      int getMonths()
      Return the number of months in the duration
      double getSeconds()
      Return the number of seconds in the duration, including fractional part
      double getTimePart()
      Return the time component of the duration - i.e.
      int getYears()
      Return the number of years in the duration
      int hashCode()  
      java.lang.String toString()
      Serializer
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XSDDuration

        public XSDDuration​(java.lang.Object value)
        Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.
        Parameters:
        value - the date/time value returned by the parsing
    • Method Detail

      • getYears

        public int getYears()
        Return the number of years in the duration
      • getMonths

        public int getMonths()
        Return the number of months in the duration
      • getDays

        public int getDays()
        Return the number of years in the duration
      • getHours

        public int getHours()
        Return the number of hours in the duration
      • getMinutes

        public int getMinutes()
        Return the number of minutes in the duration
      • getFullSeconds

        public int getFullSeconds()
        Return the number of full seconds in the duration
      • getSeconds

        public double getSeconds()
        Return the number of seconds in the duration, including fractional part
      • getBigSeconds

        public java.math.BigDecimal getBigSeconds()
        Return the number of seconds in the duration, including the fractional part, in a lossless but expensive notation - i.e. a BigDecimal.
      • getTimePart

        public double getTimePart()
        Return the time component of the duration - i.e. just the hours/mins/seconds, and returns the values in seconds.
      • toString

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

        public boolean equals​(java.lang.Object obj)
        Equality function (value based).
        Overrides:
        equals in class AbstractDateTime