net.sf.xtvdclient.xtvd.datatypes
Class DateTime

java.lang.Object
  extended by net.sf.xtvdclient.xtvd.datatypes.AbstractDataType
      extended by net.sf.xtvdclient.xtvd.datatypes.DateTime
All Implemented Interfaces:
java.lang.Comparable

public class DateTime
extends AbstractDataType

A class that represents a dateTime datatype.


Field Summary
static int OFFSET
          A constant that is used to store the time offset in milliseconds from UTC.
 
Fields inherited from class net.sf.xtvdclient.xtvd.datatypes.AbstractDataType
END_OF_LINE
 
Constructor Summary
DateTime()
          Default constructor.
DateTime(java.util.Date date)
          Create a new instance of the class with the specified date value
DateTime(java.lang.String dateTime)
          Create a new instance of the class with the specified string representation of the dateTime data type.
 
Method Summary
 java.util.Date getDate()
          Returns date.
 java.util.Date getLocalDate()
          Return a java.util.XtvdDate object that is converted from the UTC date to the your timezone.
 int hashCode()
          Returns a hash code value for this class.
 void setDate(java.util.Date date)
          Set date.
 void setDate(java.lang.String dateTime)
          Set date by parsing the dateTime string representation.
 java.lang.String toString()
          Over-ridden implementation.
 
Methods inherited from class net.sf.xtvdclient.xtvd.datatypes.AbstractDataType
compareTo, equals, replaceSpecialCharacters, replaceSpecialCharacters
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OFFSET

public static final int OFFSET
A constant that is used to store the time offset in milliseconds from UTC.

Constructor Detail

DateTime

public DateTime()
Default constructor. Not particularly useful.


DateTime

public DateTime(java.lang.String dateTime)
         throws java.text.ParseException
Create a new instance of the class with the specified string representation of the dateTime data type.

Parameters:
String - dateTime - The dateTime representation which is to be parsed.
Throws:
java.text.ParseException - - If the dateTime representation is invalid.

DateTime

public DateTime(java.util.Date date)
Create a new instance of the class with the specified date value

Parameters:
Date - date - The date to use to initialise this class.
Method Detail

getLocalDate

public java.util.Date getLocalDate()
Return a java.util.XtvdDate object that is converted from the UTC date to the your timezone.

Returns:
XtvdDate - A new XtvdDate instance that presents the equivalent time in your timezone.

toString

public java.lang.String toString()
Over-ridden implementation. Return the original dateTime string representation that was used to construct this instance, or that was used to set the date value.

Overrides:
toString in class java.lang.Object
Returns:
String - The dateTime string representation.

hashCode

public int hashCode()
Returns a hash code value for this class. Return the hash code for the date field.

Overrides:
hashCode in class java.lang.Object
Returns:
int - A hash code value for the object.
Since:
ddclient version 1.3

getDate

public final java.util.Date getDate()
Returns date.

Returns:
XtvdDate - The value/reference of/to date.

setDate

public final void setDate(java.util.Date date)
Set date.

Parameters:
Date - date - The value to set.

setDate

public final void setDate(java.lang.String dateTime)
                   throws java.text.ParseException
Set date by parsing the dateTime string representation.

Parameters:
Date - date - The value to set.
Throws:
java.text.ParseException - - If the dateTime representation specified is invalid.