org.idoox.wasp.serialization.xsdbuiltin
Class Time

java.lang.Object
  extended byorg.idoox.wasp.serialization.xsdbuiltin.DateTimeBase
      extended byorg.idoox.wasp.serialization.xsdbuiltin.Time
All Implemented Interfaces:
java.io.Serializable

public class Time
extends DateTimeBase
implements java.io.Serializable

The class represents xsd time type.

See Also:
Serialized Form
Component:
Core

Field Summary
 
Fields inherited from class org.idoox.wasp.serialization.xsdbuiltin.DateTimeBase
isNegative, timeZone
 
Constructor Summary
Time(java.util.Date date)
          Constructor, initializes object.
Time(int hour, int min, java.math.BigDecimal sec, TimeZone timeZone)
          Constructor.
Time(java.lang.String time)
          Constructor that initializes this object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Equals based on hour, min, sec and DateTimeBase values.
 int getHour()
          Returns hour member of this object.
 int getMin()
          Deprecated. Use getMinute() instead.
 int getMinute()
          Returns value of minute of this object.
 java.math.BigDecimal getSec()
          Deprecated. Use getSecond() instead.
 java.math.BigDecimal getSecond()
          Returns second value of this object.
 int hashCode()
           
 void setHour(int hour)
          Sets hour to the given value.
 void setMinute(int min)
          Sets minute to the given value.
 void setParams(java.util.Date date)
          Sets parameters of this object to the given java.util.Date object.
 void setParams(int hour, int min, java.math.BigDecimal sec, TimeZone timeZone)
          Sets parameters of this object.
 void setSecond(java.math.BigDecimal sec)
          Sets seconds to the given value.
 java.util.Date toJavaUtilDate()
          Converts parameters of this object to the java.util.Date Object.
 java.lang.String toString()
          Deserializes this object to XSD string that represents date.
 
Methods inherited from class org.idoox.wasp.serialization.xsdbuiltin.DateTimeBase
getTimeZone, hasNegativeValue, inputMonth, outputMonth, setDefaultTimeZone, setParams
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time(int hour,
            int min,
            java.math.BigDecimal sec,
            TimeZone timeZone)
     throws DateTimeException
Constructor. Initializes time object.

Parameters:
hour - a value of hour.
min - a value of minute.
sec - a value of second.
timeZone - a value of time zone. It may be null.
Throws:
DateTimeException - thrown when parameters are invalid.

Time

public Time(java.lang.String time)
     throws DateTimeException
Constructor that initializes this object.

Parameters:
time - the time string representation.
Throws:
DateTimeException - thrown when parameters are invalid.

Time

public Time(java.util.Date date)
Constructor, initializes object. Sets parameters of this object to the given java.util.Date object. Year, month, day are ignored. The DateTime object is being created with TimeZone 00:00 and other parameters got from a given java.util.Date object.

Parameters:
date - a date value to set.
Method Detail

setParams

public void setParams(int hour,
                      int min,
                      java.math.BigDecimal sec,
                      TimeZone timeZone)
               throws DateTimeException
Sets parameters of this object.

Parameters:
hour - a value of hour.
min - a value of minute.
sec - a value of second.
timeZone - a value of time zone. It may be null.
Throws:
DateTimeException - thrown when parameters are invalid.

setParams

public void setParams(java.util.Date date)
Sets parameters of this object to the given java.util.Date object. Year, month, day are ignored. The object is being created with TimeZone 00:00 and other parameters got from a given java.util.Date object.

Parameters:
date - a date value to set.

toJavaUtilDate

public java.util.Date toJavaUtilDate()
Converts parameters of this object to the java.util.Date Object.

Returns:
java.util.Date the equivalent object.

getHour

public int getHour()
Returns hour member of this object.

Returns:
hour member of this object.

getMin

public int getMin()
Deprecated. Use getMinute() instead.

Returns value of minute of this object.

Returns:
value of minute of this object.

getMinute

public int getMinute()
Returns value of minute of this object.

Returns:
value of minute of this object.

getSec

public java.math.BigDecimal getSec()
Deprecated. Use getSecond() instead.

Returns second value of this object.

Returns:
second value of this object.

getSecond

public java.math.BigDecimal getSecond()
Returns second value of this object.

Returns:
second value of this object.

setHour

public void setHour(int hour)
Sets hour to the given value.

Parameters:
hour - the given hour to set to.

setMinute

public void setMinute(int min)
Sets minute to the given value.

Parameters:
min - the given minute to set to.

setSecond

public void setSecond(java.math.BigDecimal sec)
Sets seconds to the given value.

Parameters:
sec - the given seconds value to set to.

toString

public java.lang.String toString()
Deserializes this object to XSD string that represents date.

Returns:
String date represent of the object.

equals

public boolean equals(java.lang.Object o)
Equals based on hour, min, sec and DateTimeBase values.


hashCode

public int hashCode()