Rule Execution Server API

ilog.rules.xml.types
Class IlrTime

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

public class IlrTime
extends IlrTimeZone

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

See Also:
Serialized Form

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

IlrTime

public IlrTime()
Builds a time without any time zone.


IlrTime

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

Parameters:
l - The long parameter

IlrTime

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


IlrTime

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


IlrTime

public IlrTime(String str)
        throws IlrDateFormatException
Builds a time from a string.

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

set

public void set(Date date)
Sets a time from a date.


set

public void set(Date date,
                TimeZone timeZone)
Sets a time from a date and a time zone.


setTime

public void setTime(short hour,
                    short minute,
                    short second,
                    short millisecond)
Sets a time from hour/minute/second/millisecond.


setPositive

public void setPositive(boolean positive)
Sets the time as positive.


isPositive

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


getHour

public short getHour()
Gets the hour.


getMinute

public short getMinute()
Gets the minute.


getSecond

public short getSecond()
Gets the second.


getMillisecond

public short getMillisecond()
Gets the millisecond.


toDate

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

Throws:
IlrDateFormatException

toString

public String toString()
Overrides:
toString in class IlrTimeZone

isEqual

public boolean isEqual(IlrTime dt)
Determines if two times are equal.


equals

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

compareTo

public int compareTo(IlrTime date)
Compares two times. A GREATER comparison result means that the current time is after the time used in the parameter.

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

parse

public static IlrTime parse(String str)
                     throws IlrDateFormatException
Creates a time from a string.

Throws:
IlrDateFormatException - When the string format is invalid.

valueOf

public static IlrTime valueOf(String str)
Creates a time from a string.

Throws:
IlrDateFormatException - When the string format is invalid.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013