ilog.rules.xml.types

Class IlrDateTime

  • All Implemented Interfaces:
    java.io.Serializable


    public class IlrDateTime
    extends IlrTimeZone
    This class represents the time as defined by its date and its time information. The dateTime built-in type is specified by the W3C XML Schema Recommendation (http://www.w3.org/TR/xmlschema-2/#dateTime).
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      IlrDateTime()
      Builds a dateTime structure without any time zone.
      IlrDateTime(java.util.Date date)
      Build an instance from a date without any time zone.
      IlrDateTime(java.util.Date date, java.util.TimeZone timeZone)
      Build an instance from a date and a time zone information.
      IlrDateTime(long l)
      Builds an IlrDateTime from a long.
      IlrDateTime(java.lang.String str)
      Build an instance from a string.
    • Constructor Detail

      • IlrDateTime

        public IlrDateTime()
        Builds a dateTime structure without any time zone.
      • IlrDateTime

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

        public IlrDateTime(java.util.Date date)
        Build an instance from a date without any time zone.
      • IlrDateTime

        public IlrDateTime(java.util.Date date,
                   java.util.TimeZone timeZone)
        Build an instance from a date and a time zone information.
    • Method Detail

      • set

        public void set(java.util.Date date)
        Set an instance from a date without time zone support.
      • set

        public void set(java.util.Date date,
               java.util.TimeZone timeZone)
        Set an instance from a date and a time zone.
      • setPositive

        public void setPositive(boolean positive)
        Sets as a positive dateTime.
      • setDate

        public void setDate(short century,
                   short year,
                   short month,
                   short day)
        Sets the date part of an instance as century/year/month/day/. All the fields must be positive.
      • setTime

        public void setTime(short hour,
                   short minute,
                   short second,
                   short millisecond)
        Sets the time part of a dateTime as hour/minute/second/millisecond. All the fields must be positive.
      • isPositive

        public boolean isPositive()
        Determines if the dateTime is positive.
      • getCentury

        public short getCentury()
        Get the century. As an example, the century of 1914 is 19.
      • getYear

        public short getYear()
        Get the year. As an example, the year of 1914 is 14.
      • getMonth

        public short getMonth()
        Get the month of the date.
      • getDay

        public short getDay()
        Get the day.
      • getHour

        public short getHour()
        Get the hour.
      • getMinute

        public short getMinute()
        Get the minute.
      • getSecond

        public short getSecond()
        Get the second.
      • getMillisecond

        public short getMillisecond()
        Get the remaining millisecond.
      • getFractionalSecond

        public java.lang.String getFractionalSecond()
        Get the remaining fractional second.
      • isEqual

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

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class IlrTimeZone
      • compareTo

        public int compareTo(IlrDateTime date)
        Compares two dateTimes. Note that this comparison is not compliant with the W3C specification.
        Returns:
        EQUAL if equal, GREATER or LOWER, or NOT_COMPARABLE.
      • valueOf

        public static IlrDateTime valueOf(java.lang.String str)
        Create an IlrDateTime from a string.
        Throws:
        IlrDateFormatException - when the format is not valid.

© Copyright IBM Corp. 1987, 2017