com.interfaceware.chameleon
Class ChameleonDateTime

java.lang.Object
  extended bycom.interfaceware.chameleon.ChameleonDateTime

public class ChameleonDateTime
extends java.lang.Object

This class handles Date Time objects.

See Also:
DblDate

Constructor Summary
ChameleonDateTime()
          Construct a ChameleonDateTime object.
ChameleonDateTime(DblDate Value)
          Construct a ChameleonDateTime object with the specified DblDate.
ChameleonDateTime(long Handle)
          Construct a ChameleonDateTime object with the specified long Date Time handle.
ChameleonDateTime(java.lang.String dateString)
          Construct a ChameleonDateTime object by parsing a string to produce a date.
 
Method Summary
protected  void finalize()
          Finalizer that invokes the release method.
 java.lang.String format(java.lang.String FormatString)
          Return the date as a string using the format string passed according to the formatting rules for the ANSI C strftime function.
protected  long handle()
          Get the Date Time handle for the class object.
 boolean isNull()
          Check whether the ChameleonDateTime object is empty.
static ChameleonDateTime now()
          Get the current Date Time to the nearest millisecond of the system clock.
 void release()
          Free the ChameleonDateTime object handle.
 void setValue(DblDate Value)
          Set the Date Time value with the specified DblDate.
 void setZone(short Zone)
          Set the time zone with the specified short integer.
 java.lang.String toString()
          Convert the Date Time value of the ChameleonDateTime object to a String.
 DblDate value()
          Get the Date Time value.
 short zone()
          Get the time zone as a short integer.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChameleonDateTime

public ChameleonDateTime()
                  throws ChameleonException
Construct a ChameleonDateTime object.


ChameleonDateTime

public ChameleonDateTime(long Handle)
                  throws ChameleonException
Construct a ChameleonDateTime object with the specified long Date Time handle. This constructor is used in the internal implementation of Chameleon and should not be invoked directly.


ChameleonDateTime

public ChameleonDateTime(DblDate Value)
                  throws ChameleonException
Construct a ChameleonDateTime object with the specified DblDate.


ChameleonDateTime

public ChameleonDateTime(java.lang.String dateString)
                  throws ChameleonException
Construct a ChameleonDateTime object by parsing a string to produce a date.
The date format of the string should be set before calling this constructor by setting the chameleon.date.format system property.
For example,
 	System.setProperty(chameleon.date.format, "yyyyMMdd");
 	ChameleonDateTime dt = new ChameleonDateTime("20010203");
 
Or set the date format in the call to java:
 	> java -Dchameleon.date.format=yyyyMMdd
 

See Also:
DateFormat.parse(java.lang.String)
Method Detail

now

public static ChameleonDateTime now()
                             throws ChameleonException
Get the current Date Time to the nearest millisecond of the system clock.

Throws:
ChameleonException
See Also:
DblDate.now()

release

public void release()
             throws ChameleonException
Free the ChameleonDateTime object handle.

Throws:
ChameleonException

finalize

protected void finalize()
                 throws ChameleonException
Finalizer that invokes the release method.

Throws:
ChameleonException

value

public DblDate value()
              throws ChameleonException
Get the Date Time value.

Throws:
ChameleonException

setValue

public void setValue(DblDate Value)
              throws ChameleonException
Set the Date Time value with the specified DblDate.

Throws:
ChameleonException

zone

public short zone()
           throws ChameleonException
Get the time zone as a short integer. For example, for a ChameleonDateTime with a time in the EST this method would return -5.

Throws:
ChameleonException

setZone

public void setZone(short Zone)
             throws ChameleonException
Set the time zone with the specified short integer. For example, pass in -5 for a time in the EST.

Throws:
ChameleonException

isNull

public boolean isNull()
               throws ChameleonException
Check whether the ChameleonDateTime object is empty. For example, if the Date Time is equal to "" then this method will return true.

Throws:
ChameleonException

format

public java.lang.String format(java.lang.String FormatString)
                        throws ChameleonException
Return the date as a string using the format string passed according to the formatting rules for the ANSI C strftime function. For example, if you want 19/01/2007 to be formatted as Jan. 19, 2007, you would use "%b. %d, %Y" for FormatString.

Throws:
ChameleonException

toString

public java.lang.String toString()
Convert the Date Time value of the ChameleonDateTime object to a String.


handle

protected long handle()
Get the Date Time handle for the class object. This is used in the internal implementation of Chameleon and should not be called.