ilog.rules.xml.types

Class IlrDate

  • All Implemented Interfaces:
    java.io.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
    • Constructor Summary

      Constructors 
      Constructor and Description
      IlrDate()
      Builds a new date without any time zone.
      IlrDate(java.util.Date date)
      Builds an IlrDate from a date instance.
      IlrDate(java.util.Date date, java.util.TimeZone timeZone)
      Builds an IlrDate given a date and a time zone instance.
      IlrDate(long l)
      Builds an IlrDate from a long.
      IlrDate(java.lang.String str)
      Builds an IlrDate from a string.
    • Constructor Detail

      • IlrDate

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

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

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

        public IlrDate(long l)
        Builds an IlrDate from a long.
        Parameters:
        l - The long parameter
    • Method Detail

      • set

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

        public void set(java.util.Date date,
               java.util.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.
      • 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(java.lang.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 java.lang.Object
        See Also:
        Object.hashCode()
      • valueOf

        public static IlrDate valueOf(java.lang.String str)
        Creates an IlrDate from a string.
        Throws:
        IlrDateFormatException - When the format is not valid.

© Copyright IBM Corp. 1987, 2017