Rule Execution Server API

ilog.rules.xml.types
Class IlrGYearMonth

java.lang.Object
  extended by ilog.rules.xml.types.IlrTimeZone
      extended by ilog.rules.xml.types.IlrGYearMonth
All Implemented Interfaces:
Serializable

public class IlrGYearMonth
extends IlrTimeZone

This class represents the simple type gYearMonth of the W3C XML Schema recommendation ( http://www.w3.org/TR/xmlschema-2/#gYearMonth).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ilog.rules.xml.types.IlrTimeZone
EQUAL, GREATER, LOWER
 
Constructor Summary
IlrGYearMonth()
          Builds a gYearMonth without any time zone.
IlrGYearMonth(Date date)
          Builds a gYearMonth without any time zone from a date.
IlrGYearMonth(Date date, TimeZone timeZone)
          Builds a gYearMonth from a date and a time zone.
IlrGYearMonth(long l)
          Builds an IlrGYearMonth from a long.
IlrGYearMonth(String str)
          Builds a gYearMonth from a string.
 
Method Summary
 int compareTo(IlrGYearMonth date)
          Compares two GYearMonths.
 boolean equals(Object obj)
           
 short getCentury()
          Gets the century.
 short getMonth()
          Gets the month.
 short getYear()
          Gets the year.
 boolean isEqual(IlrGYearMonth dt)
          Determines if two gYearMonth are equal.
 boolean isPositive()
          Determines if the gYearMonth is positive.
static IlrGYearMonth parse(String str)
          Creates a gYearMonth from a string.
 void set(Date date)
          Sets the gYearMonth from a date.
 void set(Date date, TimeZone timeZone)
          Sets the gYearMonth from a date and a time zone.
 void setDate(short century, short year, short month)
          Sets the gYeatrMonth from century/year/month.
 void setPositive(boolean positive)
          Sets the year as positive.
 Date toDate()
          Converts the gYearMonth to a date.
 String toString()
           
static IlrGYearMonth valueOf(String str)
          Creates a gYearMonth from a string.
 
Methods inherited from class ilog.rules.xml.types.IlrTimeZone
formatToString, formatToString, getTimeZoneInMillis, getZoneHour, getZoneMinute, isEqual, isUTC, isZonePositive, setTimeZone, setTimeZoneInMillis, setUTC, toTimeZone, unsetUTC
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlrGYearMonth

public IlrGYearMonth()
Builds a gYearMonth without any time zone.


IlrGYearMonth

public IlrGYearMonth(long l)
Builds an IlrGYearMonth from a long.

Parameters:
l - The long parameter

IlrGYearMonth

public IlrGYearMonth(Date date)
Builds a gYearMonth without any time zone from a date.


IlrGYearMonth

public IlrGYearMonth(Date date,
                     TimeZone timeZone)
Builds a gYearMonth from a date and a time zone.


IlrGYearMonth

public IlrGYearMonth(String str)
              throws IlrDateFormatException
Builds a gYearMonth from a string.

Throws:
IlrDateFormatException - When the string format is invalid.
Method Detail

set

public void set(Date date)
Sets the gYearMonth from a date.


set

public void set(Date date,
                TimeZone timeZone)
Sets the gYearMonth from a date and a time zone.


setPositive

public void setPositive(boolean positive)
Sets the year as positive.


setDate

public void setDate(short century,
                    short year,
                    short month)
Sets the gYeatrMonth from century/year/month.


isPositive

public boolean isPositive()
Determines if the gYearMonth is positive.


getCentury

public short getCentury()
Gets the century.


getYear

public short getYear()
Gets the year.


getMonth

public short getMonth()
Gets the month.


toDate

public Date toDate()
            throws IlrDateFormatException
Converts the gYearMonth to a date.

Throws:
IlrDateFormatException

toString

public String toString()
Overrides:
toString in class IlrTimeZone

isEqual

public boolean isEqual(IlrGYearMonth dt)
Determines if two gYearMonth are equal.


equals

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

compareTo

public int compareTo(IlrGYearMonth date)
Compares two GYearMonths. A GREATER comparison result means that the current GYearMonth is after the GYearMonth used in the parameter.

Returns:
EQUAL if equal, GREATER or LOWER, or NOT_COMPARABLE.

parse

public static IlrGYearMonth parse(String str)
                           throws IlrDateFormatException
Creates a gYearMonth from a string.

Throws:
IlrDateFormatException - When the string format is invalid.

valueOf

public static IlrGYearMonth valueOf(String str)
Creates a gYearMonth from a string.

Throws:
IlrDateFormatException - When the string format is invalid.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013