org.idoox.wasp.serialization.xsdbuiltin
Class Date

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

public class Date
extends DateTimeBase
implements java.io.Serializable

The class represents xsd date type.

See Also:
Serialized Form
Component:
Core

Field Summary
 
Fields inherited from class org.idoox.wasp.serialization.xsdbuiltin.DateTimeBase
isNegative, timeZone
 
Constructor Summary
Date(java.util.Date date)
          Constructor, initializes object.
Date(int year, int month, int day, TimeZone timeZone, boolean minusSign)
          Constructor.
Date(java.lang.String date)
          constructor that initializes this object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Equals based on day, month, year and DateTimeBase values.
 int getDay()
          Returns day member of this object.
 int getMonth()
          Returns month value of this object in the interval 0-11.
 int getYear()
          Returns year member of this object.
 int hashCode()
           
 void setDay(int day)
          Sets day to the given value.
 void setMonth(int month)
          Sets month 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 year, int month, int day, TimeZone timeZone, boolean isNegative)
          Sets parameters of this object.
 void setYear(int year)
          Sets year 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

Date

public Date(int year,
            int month,
            int day,
            TimeZone timeZone,
            boolean minusSign)
     throws DateTimeException
Constructor. Initializes object. Input parameters must NOT be a negative number. If timeZone value is null, date is UTC time.

Parameters:
year - a value of year.
month - a value of month (in interval 0-11).
day - a value of day.
timeZone - a value of time zone. It may be null.
minusSign - indicator that time has negative value.
Throws:
DateTimeException - thrown when parameters are invalid.

Date

public Date(java.lang.String date)
     throws DateTimeException
constructor that initializes this object.

Parameters:
date - a given date string in XML Schema format.
Throws:
DateTimeException - Description of Exception

Date

public Date(java.util.Date date)
Constructor, initializes object. Sets parameters of this object to the given java.util.Date object. The object is being created without timezone. Year, day and month are read from a given java.util.Date object (with respect to the java default timezone). Hour, minute and second are ignored.

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

setParams

public void setParams(int year,
                      int month,
                      int day,
                      TimeZone timeZone,
                      boolean isNegative)
               throws DateTimeException
Sets parameters of this object. Input parameters must NOT be a negative number. If timeZone value is null, date is UTC time.

Parameters:
year - a value of year.
month - a value of month (in interval 0-11).
day - a value of day.
timeZone - a value of time zone. It may be null.
isNegative - indicates that it is negative dateTime.
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. Hour, minute and second are ignored.

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.

getYear

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

Returns:
year member of this object.

getMonth

public int getMonth()
Returns month value of this object in the interval 0-11.

Returns:
month member of this object (in interval 0-11).

getDay

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

Returns:
day member of this object.

toString

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

Returns:
String date represent of the object.

setYear

public void setYear(int year)
Sets year to the given value.

Parameters:
year - the given year to set to.

setMonth

public void setMonth(int month)
Sets month to the given value.

Parameters:
month - the given month to set to.

setDay

public void setDay(int day)
Sets day to the given value.

Parameters:
day - the given day to set to.

equals

public boolean equals(java.lang.Object o)
Equals based on day, month, year and DateTimeBase values. All these values must be equal, for example no recalculation to different time zone is done.


hashCode

public int hashCode()