Class Time

  • All Implemented Interfaces:
    java.io.Serializable

    public class Time
    extends java.lang.Object
    implements java.io.Serializable
    Class that represents the xsd:time XML Schema type Taken from Apache Axis 1.4. Modified slightly by btsai.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Time​(long value)
      Initializes with a Calendar instance in GMT based on the number of milliseconds since midnight.
      Time​(java.lang.String value)
      Converts a string formatted as HH:mm:ss[.SSS][+/-offset]
      Time​(java.util.Calendar value)
      Initialize with a Calender, year month and date are ignored
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      long getTimeInMillis()
      Returns the time in milliseconds since midnight in UTC.
      int hashCode()
      Returns the hashcode of the underlying calendar.
      java.lang.String toString()
      stringify method returns the time as it would be in GMT, only accurate to the second...millis probably get lost.
      • Methods inherited from class java.lang.Object

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

      • Time

        public Time​(java.util.Calendar value)
        Initialize with a Calender, year month and date are ignored
        Parameters:
        value - initial value
      • Time

        public Time​(java.lang.String value)
             throws java.lang.NumberFormatException
        Converts a string formatted as HH:mm:ss[.SSS][+/-offset]
        Parameters:
        value - value
        Throws:
        java.lang.NumberFormatException - failed to parse value
      • Time

        public Time​(long value)
        Initializes with a Calendar instance in GMT based on the number of milliseconds since midnight. Year, month, and date are ignored.
        Parameters:
        value - value
    • Method Detail

      • getTimeInMillis

        public long getTimeInMillis()
        Returns the time in milliseconds since midnight in UTC.
        Returns:
        time in milli sec
      • toString

        public java.lang.String toString()
        stringify method returns the time as it would be in GMT, only accurate to the second...millis probably get lost.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns the hashcode of the underlying calendar.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an int value