org.idoox.wasp.serialization.xsdbuiltin
Class Duration

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

public class Duration
extends java.lang.Object
implements java.io.Serializable

The class represents xsd duration type.

See Also:
Serialized Form
Component:
Core

Constructor Summary
Duration(int year, int month, int day, int hour, int min, java.math.BigDecimal sec, boolean isNegative)
          Constructor.
Duration(java.lang.String duration)
          Constructor that initializes this object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Equals based on year, month, day, hour, min, sec and isNegative values.
 int getDay()
          Returns day member of this object.
 int getHour()
          Returns hour member of this object.
 int getMin()
          Returns value of minute of this object.
 int getMinute()
          Returns value of minute of this object.
 int getMonth()
          Returns month member of this object.
 java.math.BigDecimal getSec()
          Returns second value of this object.
 java.math.BigDecimal getSecond()
          Returns second value of this object.
 int getYear()
          Returns year member of this object.
 int hashCode()
           
 boolean isNegative()
          Returns whether this duration is negative.
 void setParams(int year, int month, int day, int hour, int min, java.math.BigDecimal sec, boolean isNegative)
          Sets parameters of this object.
 java.lang.String toString()
          Deserializes this object to XSD string that represents duration.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration(int year,
                int month,
                int day,
                int hour,
                int min,
                java.math.BigDecimal sec,
                boolean isNegative)
Constructor. Initializes duration object.

Parameters:
year - a value of year.
month - a value of month.
day - a value of day.
hour - a value of hour.
min - a value of minute.
sec - a value of second.
isNegative - indicates that it is negative dateTime.

Duration

public Duration(java.lang.String duration)
         throws DateTimeException
Constructor that initializes this object.

Parameters:
duration - input String in XML Schema format.
Throws:
DateTimeException - thrown when parameters are invalid.
Method Detail

setParams

public void setParams(int year,
                      int month,
                      int day,
                      int hour,
                      int min,
                      java.math.BigDecimal sec,
                      boolean isNegative)
Sets parameters of this object.

Parameters:
year - a value of year.
month - a value of month.
day - a value of day.
hour - a value of hour.
min - a value of minute.
sec - a value of second.
isNegative - indicates that it is negative dateTime.

toString

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

Returns:
duration string represent of the object.

getYear

public int getYear()
Returns year member of this object.

Returns:
year member of this object.

getMonth

public int getMonth()
Returns month member of this object.

Returns:
month member of this object.

getDay

public int getDay()
Returns day member of this object.

Returns:
day member of this object.

getHour

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

Returns:
hour member of this object.

getMin

public int getMin()
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()
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.

isNegative

public boolean isNegative()
Returns whether this duration is negative.


equals

public boolean equals(java.lang.Object o)
Equals based on year, month, day, hour, min, sec and isNegative values.


hashCode

public int hashCode()