Rule Execution Server API

ilog.rules.xml.types
Class IlrDate

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

public class IlrDate
extends IlrTimeZone

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ilog.rules.xml.types.IlrTimeZone
EQUAL, GREATER, LOWER
 
Constructor Summary
IlrDate()
          Builds a new date without any time zone.
IlrDate(Date date)
          Builds an IlrDate from a date instance.
IlrDate(Date date, TimeZone timeZone)
          Builds an IlrDate given a date and a time zone instance.
IlrDate(long l)
          Builds an IlrDate from a long.
IlrDate(String str)
          Builds an IlrDate from a string.
 
Method Summary
 int compareTo(IlrDate date)
          Determines if two dates are equal.
 boolean equals(Object obj)
           
 short getCentury()
          Gets the century of the date.
 short getDay()
          Gets the day of the date.
 short getMonth()
          Gets the month of the date.
 short getYear()
          Gets the year of the date between 0 and 99.
 int hashCode()
           
 boolean isEqual(IlrDate dt)
          Determines if two dates are equal.
 boolean isPositive()
          Determines if the date is positive.
static IlrDate parse(String str)
          Creates an IlrDate from a string.
 void set(Date date)
          Sets an IlrDate from a Date instance, without any time zone.
 void set(Date date, TimeZone timeZone)
          Sets the IlrDdate with a Date and a time zone information.
 void setCentury(short century)
          Sets the century of the date.
 void setDate(short century, short year, short month, short day)
          Sets the date as century/year/month/day.
 void setDay(short day)
          Sets the day of the date.
 void setMonth(short month)
          Sets the month of the date.
 void setPositive(boolean positive)
          Sets the sign of the date.
 void setYear(short year)
          Sets the year of the date.
 Date toDate()
          Converts the IlrDate to a java.util.Date.
 String toString()
           
static IlrDate valueOf(String str)
          Creates an IlrDate 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, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlrDate

public IlrDate()
Builds a new date without any time zone.


IlrDate

public IlrDate(Date date)
Builds an IlrDate from a date instance.


IlrDate

public IlrDate(Date date,
               TimeZone timeZone)
Builds an IlrDate given a date and a time zone instance.


IlrDate

public IlrDate(String str)
        throws IlrDateFormatException
Builds an IlrDate from a string.

Throws:
IlrDateFormatException

IlrDate

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

Parameters:
l - The long parameter
Method Detail

set

public void set(Date date)
Sets an IlrDate from a Date instance, without any time zone.


set

public void set(Date date,
                TimeZone timeZone)
Sets the IlrDdate with a Date and a time zone information.


setPositive

public void setPositive(boolean positive)
Sets the sign of the date.


setDate

public void setDate(short century,
                    short year,
                    short month,
                    short day)
Sets the date as century/year/month/day.

Parameters:
century - The century of the date. The year 1914 has 19 as century.
year - The year of the date. The year 1914 has 14 as year.
month - The month of the date, 1 for January.

setCentury

public void setCentury(short century)
Sets the century of the date.


setYear

public void setYear(short year)
Sets the year of the date.


setMonth

public void setMonth(short month)
Sets the month of the date.


setDay

public void setDay(short day)
Sets the day of the date.


isPositive

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


getCentury

public short getCentury()
Gets the century of the date.


getYear

public short getYear()
Gets the year of the date between 0 and 99.


getMonth

public short getMonth()
Gets the month of the date.


getDay

public short getDay()
Gets the day of the date.


toDate

public Date toDate()
            throws IlrDateFormatException
Converts the IlrDate to a java.util.Date.

Throws:
IlrDateFormatException

toString

public String toString()
Overrides:
toString in class IlrTimeZone

isEqual

public boolean isEqual(IlrDate dt)
Determines if two dates are equal. Note that this comparison is not compliant with the W3C specification. It is equivalent to converting the IlrDate to Date and comparing them.


equals

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

compareTo

public int compareTo(IlrDate date)
Determines if two dates are equal. Note that this comparison is not compliant with the W3C specification. It is equivalent to converting the IlrDate to Date and comparing them.


hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

parse

public static IlrDate parse(String str)
                     throws IlrDateFormatException
Creates an IlrDate from a string.

Throws:
IlrDateFormatException - When the format is not valid.

valueOf

public static IlrDate valueOf(String str)
Creates an IlrDate from a string.

Throws:
IlrDateFormatException - When the format is not valid.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013