Class XSDDuration

All Implemented Interfaces:

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 Details

    • XSDDuration

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

    • 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 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 String toString()
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Equality function (value based).
      equals in class AbstractDateTime
    • hashCode

      public int hashCode()
      hashCode in class AbstractDateTime