Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-02


oracle.rules.rl.extensions
Class Duration

java.lang.Object
  extended by oracle.rules.rl.extensions.Duration

Direct Known Subclasses:
OracleDuration

public class Duration
extends java.lang.Object

Constructor Summary
Duration()
           

 

Method Summary
static int compare(java.util.Calendar date1, java.util.Calendar date2)
          Compares two dates and returns an int value of 0 if they are equal, less than 0 if date1 represents a point in time before date2, greater than 0 if date1 represents a point in time after date2.
static int compare(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Compares two dates and returns an int value of 0 if they are equal, less than 0 if date1 represents a point in time before date2, greater than 0 if date1 represents a point in time after date2.
static int compare(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Compares two dates and returns an int value of 0 if they are equal, less than 0 if date1 represents a point in time before date2, greater than 0 if date1 represents a point in time after date2.
static int compare(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Compares two dates and returns an int value of 0 if they are equal, less than 0 if date1 represents a point in time before date2, greater than 0 if date1 represents a point in time after date2.
static int daysBetween(java.util.Calendar date1, java.util.Calendar date2)
           
static int daysBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in days.
static int daysBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in days.
static int daysBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in days.
static long hoursBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in hours.
static long hoursBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in hours.
static long hoursBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in hours.
static long hoursBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in hours.
static long millisecondsBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in milliseconds.
static long millisecondsBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in milliseconds.
static long millisecondsBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in milliseconds.
static long millisecondsBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in milliseconds.
static long minutesBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in minutes.
static long minutesBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in minutes.
static long minutesBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in minutes.
static long minutesBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in minutes.
static int monthsBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in months.
static int monthsBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in months.
static int monthsBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in months.
static int monthsBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in months.
static long secondsBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in seconds.
static long secondsBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in seconds.
static long secondsBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in seconds.
static long secondsBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in seconds.
static int weeksBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in weeks.
static int weeksBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in weeks.
static int weeksBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in weeks.
static int weeksBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in weeks.
static int yearsBetween(java.util.Calendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in years.
static int yearsBetween(java.util.Calendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in years.
static int yearsBetween(javax.xml.datatype.XMLGregorianCalendar date1, java.util.Calendar date2)
          Returns the difference between the two dates in years.
static int yearsBetween(javax.xml.datatype.XMLGregorianCalendar date1, javax.xml.datatype.XMLGregorianCalendar date2)
          Returns the difference between the two dates in years.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Duration

public Duration()

Method Detail

yearsBetween

public static int yearsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                               javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in years. The difference may be negative if date1 is later than date2. Any resulting fractional year is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of years between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

yearsBetween

public static int yearsBetween(java.util.Calendar date1,
                               java.util.Calendar date2)
Returns the difference between the two dates in years. The difference may be negative if date1 is later than date2. Any resulting fractional year is truncated.
Parameters:
date1 -
date2 -
Returns:
the number of years between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

yearsBetween

public static int yearsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                               java.util.Calendar date2)
Returns the difference between the two dates in years. The difference may be negative if date1 is later than date2. Any resulting fractional year is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of years between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

yearsBetween

public static int yearsBetween(java.util.Calendar date1,
                               javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in years. The difference may be negative if date1 is later than date2. Any resulting fractional year is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of years between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

monthsBetween

public static int monthsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                java.util.Calendar date2)
Returns the difference between the two dates in months. The difference may be negative if date1 is later than date2. Any resulting fractional month is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of months between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

monthsBetween

public static int monthsBetween(java.util.Calendar date1,
                                java.util.Calendar date2)
Returns the difference between the two dates in months. The difference may be negative if date1 is later than date2. Any resulting fractional month is truncated.
Parameters:
date1 -
date2 -
Returns:
the number of months between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

monthsBetween

public static int monthsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in months. The difference may be negative if date1 is later than date2. Any resulting fractional month is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of months between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

monthsBetween

public static int monthsBetween(java.util.Calendar date1,
                                javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in months. The difference may be negative if date1 is later than date2. Any resulting fractional month is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of months between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

weeksBetween

public static int weeksBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                               javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in weeks. The difference may be negative if date1 is later than date2. Any resulting fractional week is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of weeks between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

weeksBetween

public static int weeksBetween(java.util.Calendar date1,
                               java.util.Calendar date2)
Returns the difference between the two dates in weeks. The difference may be negative if date1 is later than date2. Any resulting fractional week is truncated.
Parameters:
date1 -
date2 -
Returns:
the number of weeks between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

weeksBetween

public static int weeksBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                               java.util.Calendar date2)
Returns the difference between the two dates in weeks. The difference may be negative if date1 is later than date2. Any resulting fractional week is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of weeks between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

weeksBetween

public static int weeksBetween(java.util.Calendar date1,
                               javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in weeks. The difference may be negative if date1 is later than date2. Any resulting fractional week is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of weeks between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

daysBetween

public static int daysBetween(java.util.Calendar date1,
                              java.util.Calendar date2)

hoursBetween

public static long hoursBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in hours. The difference may be negative if date1 is later than date2. Any resulting fractional hour is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of hours between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

hoursBetween

public static long hoursBetween(java.util.Calendar date1,
                                java.util.Calendar date2)
Returns the difference between the two dates in hours. The difference may be negative if date1 is later than date2. Any resulting fractional hour is truncated.
Parameters:
date1 -
date2 -
Returns:
the number of hours between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

daysBetween

public static int daysBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                              javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in days. The difference may be negative if date1 is later than date2. Any resulting fractional day is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of days between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

daysBetween

public static int daysBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                              java.util.Calendar date2)
Returns the difference between the two dates in days. The difference may be negative if date1 is later than date2. Any resulting fractional day is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of days between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

daysBetween

public static int daysBetween(java.util.Calendar date1,
                              javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in days. The difference may be negative if date1 is later than date2. Any resulting fractional day is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of days between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

hoursBetween

public static long hoursBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                java.util.Calendar date2)
Returns the difference between the two dates in hours. The difference may be negative if date1 is later than date2. Any resulting fractional hour is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of hours between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

hoursBetween

public static long hoursBetween(java.util.Calendar date1,
                                javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in hours. The difference may be negative if date1 is later than date2. Any resulting fractional hour is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of hours between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

minutesBetween

public static long minutesBetween(java.util.Calendar date1,
                                  java.util.Calendar date2)
Returns the difference between the two dates in minutes. The difference may be negative if date1 is later than date2. Any resulting fractional minute is truncated.
Parameters:
date1 -
date2 -
Returns:
the number of minutes between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

minutesBetween

public static long minutesBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                  javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in minutes. The difference may be negative if date1 is later than date2. Any resulting fractional minute is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of minutes between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

minutesBetween

public static long minutesBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                  java.util.Calendar date2)
Returns the difference between the two dates in minutes. The difference may be negative if date1 is later than date2. Any resulting fractional minute is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of minutes between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

minutesBetween

public static long minutesBetween(java.util.Calendar date1,
                                  javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in minutes. The difference may be negative if date1 is later than date2. Any resulting fractional minute is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of minutes between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

secondsBetween

public static long secondsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                  javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in seconds. The difference may be negative if date1 is later than date2. Any resulting fractional second is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of seconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

secondsBetween

public static long secondsBetween(java.util.Calendar date1,
                                  java.util.Calendar date2)
Returns the difference between the two dates in seconds. The difference may be negative if date1 is later than date2. Any resulting fractional second is truncated.
Parameters:
date1 -
date2 -
Returns:
the number of seconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

secondsBetween

public static long secondsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                  java.util.Calendar date2)
Returns the difference between the two dates in seconds. The difference may be negative if date1 is later than date2. Any resulting fractional second is truncated. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of seconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

secondsBetween

public static long secondsBetween(java.util.Calendar date1,
                                  javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in seconds. The difference may be negative if date1 is later than date2. Any resulting fractional second is truncated. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of seconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

millisecondsBetween

public static long millisecondsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                       javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in milliseconds. The difference may be negative if date1 is later than date2. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of milliseconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

millisecondsBetween

public static long millisecondsBetween(java.util.Calendar date1,
                                       java.util.Calendar date2)
Returns the difference between the two dates in milliseconds. The difference may be negative if date1 is later than date2.
Parameters:
date1 -
date2 -
Returns:
the number of milliseconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

millisecondsBetween

public static long millisecondsBetween(javax.xml.datatype.XMLGregorianCalendar date1,
                                       java.util.Calendar date2)
Returns the difference between the two dates in milliseconds. The difference may be negative if date1 is later than date2. date1 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of milliseconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

millisecondsBetween

public static long millisecondsBetween(java.util.Calendar date1,
                                       javax.xml.datatype.XMLGregorianCalendar date2)
Returns the difference between the two dates in milliseconds. The difference may be negative if date1 is later than date2. date2 is converted to GregorianCalendar before the difference is calculated.
Parameters:
date1 -
date2 -
Returns:
the number of milliseconds between the date1 and date2.
Throws:
java.lang.NullPointerException - if either date1 or date2 is null.

compare

public static int compare(java.util.Calendar date1,
                          java.util.Calendar date2)
Compares two dates and returns an int value
Parameters:
date1 -
date2 -
Returns:
the relative comparison result.

compare

public static int compare(javax.xml.datatype.XMLGregorianCalendar date1,
                          javax.xml.datatype.XMLGregorianCalendar date2)
Compares two dates and returns an int value
Parameters:
date1 -
date2 -
Returns:
the relative comparison result.

compare

public static int compare(javax.xml.datatype.XMLGregorianCalendar date1,
                          java.util.Calendar date2)
Compares two dates and returns an int value
Parameters:
date1 -
date2 -
Returns:
the relative comparison result.

compare

public static int compare(java.util.Calendar date1,
                          javax.xml.datatype.XMLGregorianCalendar date2)
Compares two dates and returns an int value
Parameters:
date1 -
date2 -
Returns:
the relative comparison result.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-02


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.