Rule Execution Server API

ilog.rules.xml.types
Class IlrGYear

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

public class IlrGYear
extends IlrTimeZone

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ilog.rules.xml.types.IlrTimeZone
EQUAL, GREATER, LOWER
 
Constructor Summary
IlrGYear()
          Builds a gYear without any time zone.
IlrGYear(Date date)
          Builds a gYear without a time zone from a date.
IlrGYear(Date date, TimeZone timeZone)
          Builds a gYear from a date and a time zone.
IlrGYear(long l)
          Builds an IlrGYear from a long.
IlrGYear(String str)
          Builds a gYear from a string.
 
Method Summary
 int compareTo(IlrGYear date)
          Compares two GYears.
 boolean equals(Object obj)
           
 short getCentury()
          Gets the century.
 short getYear()
          Gets the year.
 boolean isEqual(IlrGYear dt)
          Determines if two gYear are equal.
 boolean isPositive()
          Determines if the gYear is positive.
static IlrGYear parse(String str)
          Creates a gYear from a string.
 void set(Date date)
          Sets the gYear from a date.
 void set(Date date, TimeZone timeZone)
          Sets a gYear from a date and a time zone.
 void setDate(short century, short year)
          Sets the gYear from century/year.
 void setPositive(boolean positive)
          Sets the year as positive.
 Date toDate()
          Converts the gYear to a date.
 String toString()
           
static IlrGYear valueOf(String str)
          Creates a gYear 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

IlrGYear

public IlrGYear()
Builds a gYear without any time zone.


IlrGYear

public IlrGYear(Date date)
Builds a gYear without a time zone from a date.


IlrGYear

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

Parameters:
l - The long parameter

IlrGYear

public IlrGYear(Date date,
                TimeZone timeZone)
Builds a gYear from a date and a time zone.


IlrGYear

public IlrGYear(String str)
         throws IlrDateFormatException
Builds a gYear from a string.

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

set

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


set

public void set(Date date,
                TimeZone timeZone)
Sets a gYear 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)
Sets the gYear from century/year.


isPositive

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


getCentury

public short getCentury()
Gets the century.


getYear

public short getYear()
Gets the year.


toDate

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

Throws:
IlrDateFormatException

toString

public String toString()
Overrides:
toString in class IlrTimeZone

isEqual

public boolean isEqual(IlrGYear dt)
Determines if two gYear are equal.


equals

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

compareTo

public int compareTo(IlrGYear date)
Compares two GYears. A GREATER comparison result means that the current year is after the year used in the parameter.

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

parse

public static IlrGYear parse(String str)
                      throws IlrDateFormatException
Creates a gYear from a string.

Throws:
IlrDateFormatException - When the string format is invalid.

valueOf

public static IlrGYear valueOf(String str)
Creates a gYear from a string.

Throws:
IlrDateFormatException - When the string format is invalid.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013