Class TimeDuration

  • All Implemented Interfaces:
    java.io.Serializable

    public class TimeDuration
    extends java.lang.Object
    implements java.io.Serializable
    Deprecated.
    since Castor 1.0.6 since this type is not in any recommendation.
    Represents the timeDuration XML Schema type.

    This representation does not support the decimal fraction for the lowest order item. Besides setting TimeDuration to '0' is not possible thus there is no distinction between '0' and 'P0Y'

    Note: This datatype is not included in any recommendation. It was introduced in http://www.w3.org/TR/1999/WD-xmlschema-2-19990924/ and was last in http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/ and was removed by http://www.w3.org/TR/2001/PR-xmlschema-2-20010316/. It was not in the final approved recommendation: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/

    Version:
    $Revision: 6421 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
    Author:
    Arnaud Blandin
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeDuration()
      Deprecated.
      default constructor
      TimeDuration​(long l)
      Deprecated.
      This constructor fills in the time duration fields according to the value of the long by calling setValue
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean equal​(TimeDuration timeD)
      Deprecated.
      Returns true if the instance of TimeDuration has the same fields of the parameter
      boolean equals​(java.lang.Object object)
      Deprecated.
      Override the java.lang.equals method
      short getDay()
      Deprecated.
       
      short getHour()
      Deprecated.
       
      short getMilli()
      Deprecated.
       
      short getMinute()
      Deprecated.
       
      short getMonth()
      Deprecated.
       
      short getSeconds()
      Deprecated.
       
      short getYear()
      Deprecated.
       
      boolean isGreater​(TimeDuration timeD)
      Deprecated.
      Returns true if the present instance of TimeDuration is greater than the parameter
      boolean isNegative()
      Deprecated.
       
      static java.lang.Object parse​(java.lang.String str)
      Deprecated.
      parse a String and convert it into a java.lang.Object
      static TimeDuration parseTimeDuration​(java.lang.String str)
      Deprecated.
      Parse the given string and return a time duration which represents this string
      void setDay​(short day)
      Deprecated.
       
      void setHour​(short hour)
      Deprecated.
       
      void setMilli​(short milli)
      Deprecated.
       
      void setMinute​(short minute)
      Deprecated.
       
      void setMonth​(short month)
      Deprecated.
       
      void setNegative()
      Deprecated.
       
      void setSeconds​(short second)
      Deprecated.
       
      void setValue​(short year, short month, short day, short hour, short minute, short second, short millisecond)
      Deprecated.
      Fill in the fields of the TimeDuration with the given values
      void setYear​(short year)
      Deprecated.
       
      long toLong()
      Deprecated.
      Convert a timeDuration into a long This long represents the duration in milliseconds
      java.lang.String toString()
      Deprecated.
      Convert a timeDuration into a String conforming to ISO8601 and XML Schema specs
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TimeDuration

        public TimeDuration()
        Deprecated.
        default constructor
      • TimeDuration

        public TimeDuration​(long l)
        Deprecated.

        This constructor fills in the time duration fields according to the value of the long by calling setValue

        Parameters:
        l - the long value of the Time Duration
        See Also:
        setValue(short, short, short, short, short, short, short)
    • Method Detail

      • setYear

        public void setYear​(short year)
        Deprecated.
      • setMonth

        public void setMonth​(short month)
        Deprecated.
      • setDay

        public void setDay​(short day)
        Deprecated.
      • setHour

        public void setHour​(short hour)
        Deprecated.
      • setMinute

        public void setMinute​(short minute)
        Deprecated.
      • setSeconds

        public void setSeconds​(short second)
        Deprecated.
      • setMilli

        public void setMilli​(short milli)
        Deprecated.
      • setNegative

        public void setNegative()
        Deprecated.
      • setValue

        public void setValue​(short year,
                             short month,
                             short day,
                             short hour,
                             short minute,
                             short second,
                             short millisecond)
        Deprecated.
        Fill in the fields of the TimeDuration with the given values
        Parameters:
        year - the year value
        month - the month value
        day - the day value
        hour - the hour value
        minute - the minute value
        second - the second value
      • getYear

        public short getYear()
        Deprecated.
      • getMonth

        public short getMonth()
        Deprecated.
      • getDay

        public short getDay()
        Deprecated.
      • getHour

        public short getHour()
        Deprecated.
      • getMinute

        public short getMinute()
        Deprecated.
      • getSeconds

        public short getSeconds()
        Deprecated.
      • getMilli

        public short getMilli()
        Deprecated.
      • isNegative

        public boolean isNegative()
        Deprecated.
      • toLong

        public long toLong()
        Deprecated.

        Convert a timeDuration into a long This long represents the duration in milliseconds

        Returns:
        a long representing the duration
      • toString

        public java.lang.String toString()
        Deprecated.

        Convert a timeDuration into a String conforming to ISO8601 and XML Schema specs

        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representing the time duration
      • parse

        public static java.lang.Object parse​(java.lang.String str)
                                      throws java.text.ParseException
        Deprecated.
        parse a String and convert it into a java.lang.Object
        Parameters:
        str - the string to parse
        Returns:
        the java.lang.Object represented by the string
        Throws:
        java.text.ParseException - a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)
      • parseTimeDuration

        public static TimeDuration parseTimeDuration​(java.lang.String str)
                                              throws java.text.ParseException
        Deprecated.

        Parse the given string and return a time duration which represents this string

        Parameters:
        str - the string to parse
        Returns:
        a TimeDuration instance which represent the string
        Throws:
        java.text.ParseException - thrown when the string is not valid
      • equal

        public boolean equal​(TimeDuration timeD)
        Deprecated.
        Returns true if the instance of TimeDuration has the same fields of the parameter
        Parameters:
        timeD - the time duration to compare
        Returns:
        true if equal, false if not
      • isGreater

        public boolean isGreater​(TimeDuration timeD)
        Deprecated.

        Returns true if the present instance of TimeDuration is greater than the parameter

        Note This definition does not follow the XML SCHEMA DRAFT 20001024 the following orger relation is used : t1,t2 timeDuration types t1>t2 iff t1.toLong()>t2.toLong()

        Parameters:
        timeD - the time duration to compare with the present instance
        Returns:
        true if the present instance is the greatest, false if not