net.sf.xtvdclient.xtvd.datatypes
Class XtvdDate

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

public class XtvdDate
extends AbstractDataType

A class that represents a date datatype.


Field Summary
 
Fields inherited from class net.sf.xtvdclient.xtvd.datatypes.AbstractDataType
END_OF_LINE
 
Constructor Summary
XtvdDate()
          Default constructor.
XtvdDate(java.util.Date date)
          Create a new instance of the class with the specified date value
XtvdDate(java.lang.String date)
          Create a new instance of the class with the specified string representation of the date data type.
 
Method Summary
 java.util.Date getDate()
          Returns date.
 int hashCode()
          Returns a hash code value for this class.
 void setDate(java.util.Date date)
          Set date.
 void setDate(java.lang.String date)
          Set date by parsing the date 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
 

Constructor Detail

XtvdDate

public XtvdDate()
Default constructor. Not particularly useful.


XtvdDate

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

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

XtvdDate

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

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

toString

public java.lang.String toString()
Over-ridden implementation. Return the original date 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:
The date 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:
A hash code value for the object.
Since:
ddclient version 1.3

getDate

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

Returns:
The value/reference of/to date.

setDate

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

Parameters:
date - The value to set.

setDate

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

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