com.interfaceware.chameleon
Class ChameleonDateTime

java.lang.Object
  extended by com.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.
 short offsetInMinutes()
          Get the time zone offset in minutes as a short integer.
 short offsetIsDefined()
          Get the flag indicating whether the time zone offset is defined on thie CHMdateTime
 void release()
          Free the ChameleonDateTime object handle.
 void setOffsetInMinutes(short Value, short IsDefined)
          Set the time zone offset in minutes For example, pass in -5*60 for a time in the EST.
 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.

Throws:
ChameleonException

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.

Throws:
ChameleonException

ChameleonDateTime

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

Throws:
ChameleonException

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
 

Throws:
ChameleonException
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.

Overrides:
finalize in class java.lang.Object
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

offsetInMinutes

public short offsetInMinutes()
                      throws ChameleonException
Get the time zone offset in minutes as a short integer.

Throws:
ChameleonException

offsetIsDefined

public short offsetIsDefined()
                      throws ChameleonException
Get the flag indicating whether the time zone offset is defined on thie CHMdateTime

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

setOffsetInMinutes

public void setOffsetInMinutes(short Value,
                               short IsDefined)
                        throws ChameleonException
Set the time zone offset in minutes For example, pass in -5*60 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.

Overrides:
toString in class java.lang.Object

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.