org.apache.axis2.databinding.types
Class Time

java.lang.Object
  extended by org.apache.axis2.databinding.types.Time
All Implemented Interfaces:
Serializable

public class Time
extends Object
implements Serializable

Class that represents the xsd:time XML Schema type

See Also:
Serialized Form

Constructor Summary
Time(Calendar value)
          Initializes with a Calender.
Time(String value)
          Converts a string formatted as HH:mm:ss[.SSS][+/-offset]
 
Method Summary
 boolean equals(Object obj)
           
 Calendar getAsCalendar()
          Returns the time as a calendar.
 int hashCode()
          Returns the hashcode of the underlying calendar.
 void setTime(Calendar date)
          Sets the time; ignores year, month, date
 void setTime(Date date)
          Sets the time from a date instance.
 String toString()
          Returns the time as it would be in GMT.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time(Calendar value)
Initializes with a Calender. Year, month and date are ignored.


Time

public Time(String value)
     throws NumberFormatException
Converts a string formatted as HH:mm:ss[.SSS][+/-offset]

Throws:
NumberFormatException
Method Detail

getAsCalendar

public Calendar getAsCalendar()
Returns the time as a calendar. Ignores the year, month and date fields.

Returns:
Returns calendar value; may be null.

setTime

public void setTime(Calendar date)
Sets the time; ignores year, month, date

Parameters:
date -

setTime

public void setTime(Date date)
Sets the time from a date instance.

Parameters:
date -

toString

public String toString()
Returns the time as it would be in GMT. This is accurate to the seconds. Milliseconds probably gets lost.

Overrides:
toString in class Object
Returns:
Returns String.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Returns the hashcode of the underlying calendar.

Overrides:
hashCode in class Object
Returns:
Returns an int value.


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.