biz.c24.io.api.data
Class ISO8601GYearMonth

java.lang.Object
  extended by biz.c24.io.api.data.ISO8601Value
      extended by biz.c24.io.api.data.ISO8601GYearMonth
All Implemented Interfaces:
Serializable, Comparable

public class ISO8601GYearMonth
extends ISO8601Value

An object representing an ISO8601 gYearMonth.

Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.

See Also:
ISO8601GYearMonthDataType, Serialized Form

Field Summary
 
Fields inherited from class biz.c24.io.api.data.ISO8601Value
CALENDAR, IO_ISO8601_TIME_ZONE_PRESENT, IO_ISO8601_TIME_ZONE_ZERO, TIME_ZONE_UTC, timeZone
 
Constructor Summary
ISO8601GYearMonth()
          Constructs a new instance.
ISO8601GYearMonth(Date date)
          Constructs a new instance from the specified date.
ISO8601GYearMonth(long date)
          Constructs a new instance from the specified date.
ISO8601GYearMonth(long date, TimeZone timeZone)
          Constructs a new instance from the specified date.
ISO8601GYearMonth(String str)
          Constructs a new instance from the specified string.
 
Method Summary
protected  void adjustTimeZoneInternal()
          Internal calculations required for adjusting this object to the new time zone value.
 int compareTo(Object o)
           
static ISO8601GYearMonth create(String str)
          Returns an instance parsed from the specified string.
 boolean equals(Object obj)
           
 short getCentury()
          Returns the century component of the date.
 short getMonth()
          Returns the month component of the date.
 short getYear()
          Returns the year component of the date.
 short getZoneHour()
          Returns the hour component of the time zone.
 short getZoneMinute()
          Returns the minute component of the time zone.
 int hashCode()
           
 boolean isUTC()
          Returns whether this is in UTC.
 boolean isZoneNegative()
          Returns whether the time zone if negative.
protected  void setInternal(long date)
          Sets internal date/time values using date value.
 Date toDate()
          Converts this object into a Date.
 long toLong()
          Converts this object into a long.
 String toString()
           
 
Methods inherited from class biz.c24.io.api.data.ISO8601Value
adjustTimeZone, getDefaultTimeZone, getTimeZone, getTimeZoneInternal, setTimeZone, setTimeZone, setZoneOffsetInternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ISO8601GYearMonth

public ISO8601GYearMonth()
Constructs a new instance.


ISO8601GYearMonth

public ISO8601GYearMonth(String str)
                  throws ParserException
Constructs a new instance from the specified string.

Parameters:
str - The string to parse.
Throws:
ParserException - If the string could not be parsed.

ISO8601GYearMonth

public ISO8601GYearMonth(Date date)
Constructs a new instance from the specified date. Default (local) time zone is used.

Parameters:
date - The date to convert from.

ISO8601GYearMonth

public ISO8601GYearMonth(long date)
Constructs a new instance from the specified date. Default (local) time zone is used.

Parameters:
date - The date to convert from.

ISO8601GYearMonth

public ISO8601GYearMonth(long date,
                         TimeZone timeZone)
Constructs a new instance from the specified date.

Parameters:
date - The date to convert from.
timeZone - The time zone to use.
Method Detail

setInternal

protected void setInternal(long date)
Description copied from class: ISO8601Value
Sets internal date/time values using date value.

Specified by:
setInternal in class ISO8601Value
Parameters:
date - date value to use

create

public static ISO8601GYearMonth create(String str)
                                throws DateFormatException
Returns an instance parsed from the specified string.

This convenience factory method works as if by invoking the ISO8601GYearMonth(String) constructor; any ParserException thrown by the constructor is caught and wrapped in a new DateFormatException object, which is then thrown.

This method is provided for use in situations where it is known that the given string is a legal value, for example for constants declared within in a program, and so it would be considered a programming error for the string not to parse as such. The constructor, which throws a ParserException directly, should be used in situations where a value is being constructed from user input or from some other source that may be prone to errors.

Parameters:
str - The string to parse.
Returns:
A value parsed from the string.
Throws:
DateFormatException - If the string could not be parsed.
NullPointerException - If str is null.

getZoneHour

public short getZoneHour()
Returns the hour component of the time zone.

Returns:
The time zone hour.

getZoneMinute

public short getZoneMinute()
Returns the minute component of the time zone.

Returns:
The time zone minute.

isZoneNegative

public boolean isZoneNegative()
Returns whether the time zone if negative.

Returns:
Whether the time zone is negative.

isUTC

public boolean isUTC()
Returns whether this is in UTC.

A date/time is in UTC if a 'Z' appears at the end of the lexical representation or if it contains a time zone.

Returns:
Whether this is in UTC.

getCentury

public short getCentury()
Returns the century component of the date.

Returns:
The century.

getYear

public short getYear()
Returns the year component of the date.

Returns:
The year.

getMonth

public short getMonth()
Returns the month component of the date.

Returns:
The month.

toDate

public Date toDate()
Description copied from class: ISO8601Value
Converts this object into a Date.

Specified by:
toDate in class ISO8601Value
Returns:
The date.

toLong

public long toLong()
Description copied from class: ISO8601Value
Converts this object into a long.

Specified by:
toLong in class ISO8601Value
Returns:
The date.

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object o)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

adjustTimeZoneInternal

protected void adjustTimeZoneInternal()
Description copied from class: ISO8601Value
Internal calculations required for adjusting this object to the new time zone value.

Specified by:
adjustTimeZoneInternal in class ISO8601Value


C24 Technologies © 2002-2012: All Rights Reserved.