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
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      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)  
      java.util.Calendar getAsCalendar()
      return the time as a calendar: ignore the year, month and date fields
      int hashCode()
      Returns the hashcode of the underlying calendar.
      void setTime​(java.util.Calendar date)
      set the time; ignore year, month, date
      void setTime​(java.util.Date date)
      set the time from a date instance
      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
      • Time

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

      • getAsCalendar

        public java.util.Calendar getAsCalendar()
        return the time as a calendar: ignore the year, month and date fields
        Returns:
        calendar value; may be null
      • setTime

        public void setTime​(java.util.Calendar date)
        set the time; ignore year, month, date
        Parameters:
        date -
      • setTime

        public void setTime​(java.util.Date date)
        set the time from a date instance
        Parameters:
        date -
      • 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:
      • 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