biz.c24.io.api.data
Class ISO8601Value

java.lang.Object
  extended by biz.c24.io.api.data.ISO8601Value
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
ISO8601Date, ISO8601DateTime, ISO8601Duration, ISO8601GDay, ISO8601GMonth, ISO8601GMonthDay, ISO8601GYear, ISO8601GYearMonth, ISO8601Time

public abstract class ISO8601Value
extends Object
implements Serializable, Comparable

The abstract class which aggregates the common functionality exhibited by all ISO8601 values.

See Also:
Serialized Form

Field Summary
protected static Calendar CALENDAR
          Calendar instance (shared) to be used for date/time calculation with time zones.
static String IO_ISO8601_TIME_ZONE_PRESENT
          Deprecated. Use Utils.SYSTEM_PROPERTY_ISO8601_TIME_ZONE_PRESENT instead.
static String IO_ISO8601_TIME_ZONE_ZERO
          Deprecated. Use Utils.SYSTEM_PROPERTY_ISO8601_TIME_ZONE_ZERO instead.
protected static TimeZone TIME_ZONE_UTC
          UTC time zone instance.
protected  TimeZone timeZone
          Time zone.
 
Constructor Summary
ISO8601Value()
           
 
Method Summary
 void adjustTimeZone(TimeZone timeZone)
          Adjusts this object to the specified time zone.
protected abstract  void adjustTimeZoneInternal()
          Internal calculations required for adjusting this object to the new time zone value.
protected static TimeZone getDefaultTimeZone()
          Returns default time zone.
 TimeZone getTimeZone()
          Returns time zone of this object.
protected  TimeZone getTimeZoneInternal()
          Returns time zone of this object.
protected abstract  void setInternal(long date)
          Sets internal date/time values using date value.
protected  void setTimeZone(biz.c24.io.api.data.exolab.castor.types.DateTimeBase dateTimeBase)
          Sets the time zone value from the provided date/time object.
 void setTimeZone(TimeZone timeZone)
          Sets time zone for this object.
protected  void setZoneOffsetInternal(biz.c24.io.api.data.exolab.castor.types.DateTimeBase value)
           
abstract  Date toDate()
          Converts this object into a Date.
abstract  long toLong()
          Converts this object into a long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

CALENDAR

protected static final Calendar CALENDAR
Calendar instance (shared) to be used for date/time calculation with time zones. Access/usage must be synchronized.


TIME_ZONE_UTC

protected static final TimeZone TIME_ZONE_UTC
UTC time zone instance.


IO_ISO8601_TIME_ZONE_PRESENT

public static final String IO_ISO8601_TIME_ZONE_PRESENT
Deprecated. Use Utils.SYSTEM_PROPERTY_ISO8601_TIME_ZONE_PRESENT instead.
The System property key used to specify ISO8601 values should be written out with a time zone.

See Also:
Constant Field Values

IO_ISO8601_TIME_ZONE_ZERO

public static final String IO_ISO8601_TIME_ZONE_ZERO
Deprecated. Use Utils.SYSTEM_PROPERTY_ISO8601_TIME_ZONE_ZERO instead.
The System property key used to specify ISO8601 values with a zero offset timezone should be written out with a time zone of 00:00 rather than Z.

See Also:
Constant Field Values

timeZone

protected TimeZone timeZone
Time zone.

Constructor Detail

ISO8601Value

public ISO8601Value()
Method Detail

toDate

public abstract Date toDate()
Converts this object into a Date.

Returns:
The date.

toLong

public abstract long toLong()
Converts this object into a long.

Returns:
The date.

getDefaultTimeZone

protected static TimeZone getDefaultTimeZone()
Returns default time zone.

Returns:
default time zone

setTimeZone

public final void setTimeZone(TimeZone timeZone)
Sets time zone for this object. Date/time values are re-calculated.

Parameters:
timeZone - time zone to set for this object, null means no TZ

setInternal

protected abstract void setInternal(long date)
Sets internal date/time values using date value.

Parameters:
date - date value to use

setTimeZone

protected void setTimeZone(biz.c24.io.api.data.exolab.castor.types.DateTimeBase dateTimeBase)
Sets the time zone value from the provided date/time object. Sets the internal time zone field to the calculated value.

Parameters:
dateTimeBase - date/time object to extract time zone from

getTimeZoneInternal

protected TimeZone getTimeZoneInternal()
Returns time zone of this object.

Returns:
time zone of this object or default time zone if is not set

getTimeZone

public TimeZone getTimeZone()
Returns time zone of this object.

Returns:
time zone of this object, null means no TZ

adjustTimeZone

public void adjustTimeZone(TimeZone timeZone)
Adjusts this object to the specified time zone. Date/time values are not changed.

Parameters:
timeZone - time zone to adjust this object to, null means no TZ

adjustTimeZoneInternal

protected abstract void adjustTimeZoneInternal()
Internal calculations required for adjusting this object to the new time zone value.


setZoneOffsetInternal

protected void setZoneOffsetInternal(biz.c24.io.api.data.exolab.castor.types.DateTimeBase value)


C24 Technologies © 2002-2012: All Rights Reserved.