org.exolab.castor.types
Class GMonth

java.lang.Object
  extended byorg.exolab.castor.types.DateTimeBase
      extended byorg.exolab.castor.types.Date
          extended byorg.exolab.castor.types.GMonthDay
              extended byorg.exolab.castor.types.GMonth
All Implemented Interfaces:
java.io.Serializable

public class GMonth
extends GMonthDay

Describe an XML schema gMonth type.

The format is defined by W3C XML Schema Recommendation and ISO8601 i.e --MM--(Z|(+|-)hh:mm)

Version:
$Revision: 1.1.1.1 $
Author:
Arnaud Blandin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.exolab.castor.types.Date
DATE_FORMAT
 
Fields inherited from class org.exolab.castor.types.DateTimeBase
EQUALS, GREATER_THAN, INDETERMINATE, LESS_THAN
 
Constructor Summary
GMonth()
          public only for the generated source code
GMonth(int month)
          Constructs a XML Schema GMonth instance given all the values of the different fields.
GMonth(short month)
          Constructs a XML Schema GMonth instance given all the values of the different fields.
GMonth(java.lang.String gmonth)
          Constructs a GMonth from a string value.
 
Method Summary
 short getDay()
           
static java.lang.Object parse(java.lang.String str)
          parse a String and convert it into an java.lang.Object
static GMonth parseGMonth(java.lang.String str)
          parse a String and convert it into a GMonth.
 void setDay(short day)
          set the Day Field
 java.util.Date toDate()
          converts this GMonth into a local java Date.
 java.lang.String toString()
          convert this GMonth to a string The format is defined by W3C XML Schema recommendation and ISO8601 i.e --MM--(Z|(+|-)hh:mm)
 
Methods inherited from class org.exolab.castor.types.GMonthDay
getCentury, getValues, getYear, parseGMonthDay, setCentury, setNegative, setValues, setYear
 
Methods inherited from class org.exolab.castor.types.Date
getHour, getMilli, getMinute, getSeconds, parseDate, setHour, setMilliSecond, setMinute, setSecond
 
Methods inherited from class org.exolab.castor.types.DateTimeBase
addDuration, compareTo, equals, getMonth, getZoneHour, getZoneMinute, hashCode, isLeap, isNegative, isUTC, isZoneNegative, normalize, setMonth, setSecond, setUTC, setZone, setZoneHour, setZoneMinute, setZoneNegative, toCalendar
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GMonth

public GMonth()
public only for the generated source code


GMonth

public GMonth(short month)
Constructs a XML Schema GMonth instance given all the values of the different fields. By default a GMonth is not UTC and is local.

Parameters:
month - the month value.

GMonth

public GMonth(int month)
Constructs a XML Schema GMonth instance given all the values of the different fields. By default a GMonth is not UTC and is local.

Parameters:
month - the month value.

GMonth

public GMonth(java.lang.String gmonth)
       throws java.text.ParseException
Constructs a GMonth from a string value.

Parameters:
gmonth - the string representation of the GMonth to instantiate
Method Detail

toDate

public java.util.Date toDate()
converts this GMonth into a local java Date.

Overrides:
toDate in class GMonthDay
Returns:
a local date representing this Date.

toString

public java.lang.String toString()
convert this GMonth to a string The format is defined by W3C XML Schema recommendation and ISO8601 i.e --MM--(Z|(+|-)hh:mm)

Overrides:
toString in class GMonthDay
Returns:
a string representing this Date

parse

public static java.lang.Object parse(java.lang.String str)
                              throws java.text.ParseException
parse a String and convert it into an java.lang.Object

Parameters:
str - the string to parse
Returns:
an Object represented by the string
Throws:
java.text.ParseException - a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

parseGMonth

public static GMonth parseGMonth(java.lang.String str)
                          throws java.text.ParseException
parse a String and convert it into a GMonth.

Parameters:
str - the string to parse
Returns:
the Date represented by the string
Throws:
java.text.ParseException - a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

getDay

public short getDay()
Overrides:
getDay in class DateTimeBase

setDay

public void setDay(short day)
Description copied from class: DateTimeBase
set the Day Field

Overrides:
setDay in class DateTimeBase
Parameters:
day - the value to set up Note a validation is done on the day field


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com