ilog.rules.xml.types

Class IlrDuration

  • java.lang.Object
    • ilog.rules.xml.types.IlrDuration
  • All Implemented Interfaces:
    java.io.Serializable


    public class IlrDuration
    extends java.lang.Object
    implements java.io.Serializable
    This class represents a duration specified by the W3C recommendation ( http://www.w3.org/TR/xmlschema-2/#duration).
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      IlrDuration()
      Build a null duration.
      IlrDuration(boolean positive, short year, short month, short day, short hour, short minute, short second)
      Build a duration defined by year/month/day/hour/minute/second.
      IlrDuration(java.lang.String str)
      Build a duration from a string.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int compareTo(IlrDuration date)
      Compare two durations.
      boolean equals(java.lang.Object obj) 
      short getDay()
      Get the day.
      java.lang.String getFractionalSecond()
      Get the remaining fractional second.
      short getHour()
      Get the hour.
      short getMinute()
      Get the minute.
      short getMonth()
      Get the month.
      short getSeconds()
      Get the second.
      short getYear()
      Get the year.
      boolean isEqual(IlrDuration d)
      Determine if two duration objects are equal.
      boolean isNegative()
      Determine if the duration is negative.
      boolean isPositive()
      Determine if the duration is positive.
      static IlrDuration parse(java.lang.String str)
      Create a duration from a string.
      void setDay(short day)
      Set the day.
      void setHour(short hour)
      Set the hour.
      void setMinute(short minute)
      Set the minute.
      void setMonth(short month)
      Set the month.
      void setSecond(short second)
      set the second.
      void setSign(boolean positive)
      Set the sign of the duration.
      void setValue(boolean isPositive, short year, short month, short day, short hour, short minute, short second)
      Set the duration.
      void setYear(short year)
      Set the year.
      java.lang.String toString() 
      static IlrDuration valueOf(java.lang.String str)
      Create a duration from a string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IlrDuration

        public IlrDuration()
        Build a null duration.
      • IlrDuration

        public IlrDuration(boolean positive,
                   short year,
                   short month,
                   short day,
                   short hour,
                   short minute,
                   short second)
        Build a duration defined by year/month/day/hour/minute/second.
    • Method Detail

      • setYear

        public void setYear(short year)
        Set the year.
      • setMonth

        public void setMonth(short month)
        Set the month.
      • setDay

        public void setDay(short day)
        Set the day.
      • setHour

        public void setHour(short hour)
        Set the hour.
      • setMinute

        public void setMinute(short minute)
        Set the minute.
      • setSecond

        public void setSecond(short second)
        set the second.
      • setSign

        public void setSign(boolean positive)
        Set the sign of the duration.
      • setValue

        public void setValue(boolean isPositive,
                    short year,
                    short month,
                    short day,
                    short hour,
                    short minute,
                    short second)
        Set the duration.
      • getYear

        public short getYear()
        Get the year.
      • getMonth

        public short getMonth()
        Get the month.
      • getDay

        public short getDay()
        Get the day.
      • getHour

        public short getHour()
        Get the hour.
      • getMinute

        public short getMinute()
        Get the minute.
      • getSeconds

        public short getSeconds()
        Get the second.
      • getFractionalSecond

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

        public boolean isPositive()
        Determine if the duration is positive.
      • isNegative

        public boolean isNegative()
        Determine if the duration is negative.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isEqual

        public boolean isEqual(IlrDuration d)
        Determine if two duration objects 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 java.lang.Object
      • compareTo

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

        public static IlrDuration valueOf(java.lang.String str)
        Create a duration from a string.
        Throws:
        IlrDateFormatException - when the string format is invalid.

© Copyright IBM Corp. 1987, 2017