Class OracleDuration

java.lang.Object
oracle.rules.rl.extensions.Duration
oracle.rules.sdk2.extensions.OracleDuration

public final class OracleDuration extends Duration
  • Method Details

    • yearsBetween

      public static int yearsBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in years. The difference may be negative if the first date is later than the second date. Any resulting fractional year is truncated. ts1 and ts2 are converted to instances of GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of years between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • yearsBetween

      public static int yearsBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in years. The difference may be negative if the first date is later than the second date. Any resulting fractional year is truncated. ts1 is converted to an instance of GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of years between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • yearsBetween

      public static int yearsBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in years. The difference may be negative if the first date is later than the second date. Any resulting fractional year is truncated. date2 is converted to an instance of GregorianCalendar before the difference is calculated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of years between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • yearsBetween

      public static int yearsBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in years. The difference may be negative if the first date is later than the second date. Any resulting fractional year is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending XMLGregorianCalendar instance
      Returns:
      the number of years between the date1 and date2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • yearsBetween

      public static int yearsBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in years. The difference may be negative if the first date is later than the second date. Any resulting fractional year is truncated. date1 and date2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of years between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • monthsBetween

      public static int monthsBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in months. The difference may be negative if the first date is later than the second date. Any resulting fractional month is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of months between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • monthsBetween

      public static int monthsBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in months. The difference may be negative if the first date is later than the second date. Any resulting fractional month is truncated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of months between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • monthsBetween

      public static int monthsBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in months. The difference may be negative if the first date is later than the second date. Any resulting fractional month is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of months between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • monthsBetween

      public static int monthsBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in months. The difference may be negative if the first date is later than the second date. Any resulting fractional month is truncated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of months between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • monthsBetween

      public static int monthsBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in months. The difference may be negative if the first date is later than the second date. Any resulting fractional month is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending XMLGregorianCalendar instance
      Returns:
      the number of months between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • weeksBetween

      public static int weeksBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in weeks. The difference may be negative if the first date is later than the second date. Any resulting fractional week is truncated. ts1 and ts2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of weeks between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • weeksBetween

      public static int weeksBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in weeks. The difference may be negative if the first date is later than the second date. Any resulting fractional week is truncated. ts1 and cal2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of weeks between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • weeksBetween

      public static int weeksBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in weeks. The difference may be negative if the first date is later than the second date. Any resulting fractional week is truncated. cal1 and ts2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of weeks between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • weeksBetween

      public static int weeksBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in weeks. The difference may be negative if the first date is later than the second date. Any resulting fractional week is truncated. ts1 and cal2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending XMLGregorianCalendar instance
      Returns:
      the number of weeks between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • weeksBetween

      public static int weeksBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in weeks. The difference may be negative if the first date is later than the second date. Any resulting fractional week is truncated. cal1 and ts2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of weeks between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • daysBetween

      public static int daysBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in days. The difference may be negative if the first date is later than the second date. Any resulting fractional day is truncated. ts1 and ts2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of weeks between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • daysBetween

      public static int daysBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in days. The difference may be negative if the first date is later than the second date. Any resulting fractional day is truncated. cal1 and ts2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of weeks between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • daysBetween

      public static int daysBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in days. The difference may be negative if the first date is later than the second date. Any resulting fractional day is truncated. ts1 and cal2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of weeks between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • daysBetween

      public static int daysBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in days. The difference may be negative if the first date is later than the second date. Any resulting fractional day is truncated. cal1 and ts2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of weeks between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • daysBetween

      public static int daysBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in days. The difference may be negative if the first date is later than the second date. Any resulting fractional day is truncated. ts1 and cal2 are converted to GregorianCalendar before the difference is calculated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of weeks between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • hoursBetween

      public static long hoursBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in hours. The difference may be negative if the first date is later than the second date. Any resulting fractional hour is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of hours between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • hoursBetween

      public static long hoursBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in hours. The difference may be negative if the first date is later than the second date. Any resulting fractional hour is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of hours between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • hoursBetween

      public static long hoursBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in hours. The difference may be negative if the first date is later than the second date. Any resulting fractional hour is truncated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of hours between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • hoursBetween

      public static long hoursBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in hours. The difference may be negative if the first date is later than the second date. Any resulting fractional hour is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of hours between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • hoursBetween

      public static long hoursBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in hours. The difference may be negative if the first date is later than the second date. Any resulting fractional hour is truncated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of hours between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • minutesBetween

      public static long minutesBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in minutes. The difference may be negative if the first date is later than the second date. Any resulting fractional minute is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of minutes between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • minutesBetween

      public static long minutesBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in minutes. The difference may be negative if the first date is later than the second date. Any resulting fractional minute is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of minutes between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • minutesBetween

      public static long minutesBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in minutes. The difference may be negative if the first date is later than the second date. Any resulting fractional minute is truncated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of minutes between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • minutesBetween

      public static long minutesBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in minutes. The difference may be negative if the first date is later than the second date. Any resulting fractional minute is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of minutes between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • minutesBetween

      public static long minutesBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in minutes. The difference may be negative if the first date is later than the second date. Any resulting fractional minute is truncated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of minutes between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • secondsBetween

      public static long secondsBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in seconds. The difference may be negative if the first date is later than the second date. Any resulting fractional second is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of seconds between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • secondsBetween

      public static long secondsBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in seconds. The difference may be negative if the first date is later than the second date. Any resulting fractional second is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of seconds between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • secondsBetween

      public static long secondsBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in seconds. The difference may be negative if the first date is later than the second date. Any resulting fractional second is truncated.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of seconds between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • secondsBetween

      public static long secondsBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in seconds. The difference may be negative if the first date is later than the second date. Any resulting fractional second is truncated.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of seconds between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • secondsBetween

      public static long secondsBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in seconds. The difference may be negative if the first date is later than the second date. Any resulting fractional second is truncated.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of seconds between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • millisecondsBetween

      public static long millisecondsBetween(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in milliseconds. The difference may be negative if the first date is later than the second date.
      Parameters:
      ts1 - the starting Timestamp instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of milliseconds between the ts1 and ts2.
      Throws:
      NullPointerException - if either ts1 or ts2 is null.
    • millisecondsBetween

      public static long millisecondsBetween(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in milliseconds. The difference may be negative if the first date is later than the second date.
      Parameters:
      cal1 - the starting Calendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of milliseconds between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • millisecondsBetween

      public static long millisecondsBetween(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Returns the difference between the two dates in milliseconds. The difference may be negative if the first date is later than the second date.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending Calendar instance
      Returns:
      the number of milliseconds between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • millisecondsBetween

      public static long millisecondsBetween(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Returns the difference between the two dates in milliseconds. The difference may be negative if the first date is later than the second date.
      Parameters:
      cal1 - the starting XMLGregorianCalendar instance
      ts2 - the ending Timestamp instance
      Returns:
      the number of milliseconds between the cal1 the ts2.
      Throws:
      NullPointerException - if either cal1 or ts2 is null.
    • millisecondsBetween

      public static long millisecondsBetween(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Returns the difference between the two dates in milliseconds. The difference may be negative if the first date is later than the second date.
      Parameters:
      ts1 - the starting Timestamp instance
      cal2 - the ending XMLGregorianCalendar instance
      Returns:
      the number of milliseconds between the ts1 and cal2.
      Throws:
      NullPointerException - if either ts1 or cal2 is null.
    • compare

      public static int compare(oracle.jbo.domain.Timestamp ts1, oracle.jbo.domain.Timestamp ts2)
      Compares two dates and returns an int value
      • of 0 if they are equal,
      • less than 0 if ts1 represents a point in time before ts2,
      • greater than 0 if ts1 represents a point in time after ts2.
      Parameters:
      ts1 - the left-hand side Timestamp instance
      ts2 - the right-hand side Timestamp instance
      Returns:
      the relative comparison result.
    • compare

      public static int compare(oracle.jbo.domain.Timestamp ts1, Calendar cal2)
      Compares two dates and returns an int value
      • of 0 if they are equal,
      • less than 0 if ts1 represents a point in time before cal2,
      • greater than 0 if ts1 represents a point in time after cal2.
      Parameters:
      ts1 - the left-hand side Timestamp instance
      cal2 - the right-hand side Calendar instance
      Returns:
      the relative comparison result.
    • compare

      public static int compare(Calendar cal1, oracle.jbo.domain.Timestamp ts2)
      Compares two dates and returns an int value
      • of 0 if they are equal,
      • less than 0 if cal1 represents a point in time before ts2,
      • greater than 0 if cal1 represents a point in time after ts2.
      Parameters:
      cal1 - the left-hand side Calendar instance
      ts2 - the right-hand side Timestamp instance
      Returns:
      the relative comparison result.
    • compare

      public static int compare(oracle.jbo.domain.Timestamp ts1, XMLGregorianCalendar cal2)
      Compares two dates and returns an int value
      • of 0 if they are equal,
      • less than 0 if ts1 represents a point in time before cal2,
      • greater than 0 if ts1 represents a point in time after cal2.
      Parameters:
      ts1 - the left-hand side Timestamp instance
      cal2 - the right-hand side XMLGregorianCalendar instance
      Returns:
      the relative comparison result.
    • compare

      public static int compare(XMLGregorianCalendar cal1, oracle.jbo.domain.Timestamp ts2)
      Compares two dates and returns an int value
      • of 0 if they are equal,
      • less than 0 if cal1 represents a point in time before ts2,
      • greater than 0 if cal1 represents a point in time after ts2.
      Parameters:
      cal1 - the left-hand side XMLGregorianCalendar instance
      ts2 - the right-hand side Timestamp instance
      Returns:
      the relative comparison result.
    • between

      public static Duration between(oracle.jbo.domain.Timestamp date1, oracle.jbo.domain.Timestamp date2)
      Compute XML dayTimeDuration between 2 dates. Result will be negative if date1 > date2.
      Parameters:
      date1 - first (earlier) date
      date2 - second (later) date
      Returns:
      XML Duration
    • between

      public static Duration between(oracle.jbo.domain.Timestamp date1, Calendar date2)
      Compute XML dayTimeDuration between 2 dates. Result will be negative if date1 > date2.
      Parameters:
      date1 - first (earlier) date
      date2 - second (later) date
      Returns:
      XML Duration
    • between

      public static Duration between(Calendar date1, oracle.jbo.domain.Timestamp date2)
      Compute XML dayTimeDuration between 2 dates. Result will be negative if date1 > date2.
      Parameters:
      date1 - first (earlier) date
      date2 - second (later) date
      Returns:
      XML Duration
    • between

      public static Duration between(oracle.jbo.domain.Timestamp date1, XMLGregorianCalendar date2)
      Compute XML dayTimeDuration between 2 dates. Result will be negative if date1 > date2.
      Parameters:
      date1 - first (earlier) date
      date2 - second (later) date
      Returns:
      XML Duration
    • between

      public static Duration between(XMLGregorianCalendar date1, oracle.jbo.domain.Timestamp date2)
      Compute XML dayTimeDuration between 2 dates. Result will be negative if date1 > date2.
      Parameters:
      date1 - first (earlier) date
      date2 - second (later) date
      Returns:
      XML Duration