|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfuego.lang.Interval
Space of time between any two points or events. The "Interval" class represents the time between two events in the time, as for example, the quantity of days in which a sale order will due (difference between 'now' and the order due date). The interval may be represented by a number of years, months, days, hours, minutes, seconds. It will depend on the possibility of expressing the interval in those units. As the interval is a quantity of time and it does not include a date sometimes it is not possible to express the years, months, days, etc. It stores time offsets, including time-of-day offsets. It makes no timezone correction, since it does not include a date. When an interval is created from the difference between two dates, something like:
| d1, d2 as Time d1 = Time(1961, 1, 1) d2 = 'now' interval = d2 - d1 |
| Nested Class Summary | |
static class |
Interval.Holder
|
| Field Summary | |
static Interval |
ONE_DAY
A One day Interval |
static Interval |
ONE_HOUR
A One hour Interval |
static Interval |
ONE_MINUTE
A One minute Interval |
static Interval |
ONE_MONTH
A One month Interval |
static Interval |
ONE_SECOND
A One second Interval |
static Interval |
ONE_WEEK
A One week Interval |
static Interval |
ZERO
Zero Interval |
| Constructor Summary | |
Interval()
|
|
| Method Summary | |
Interval |
abs()
Absolute value of this object. |
Interval |
add(Interval t)
Adds an Interval. |
static Interval |
add(Interval op1,
Interval op2)
Adds two Intervals. |
Time |
add(Time t)
Adds a interval to the Time specified as parameter. |
Interval |
addDays(int i)
Adds days to an interval. |
Interval |
addHours(long i)
Adds hours to an interval. |
Interval |
addMicroSeconds(long i)
Adds micro-seconds to this interval |
Interval |
addMinutes(long i)
Adds minutes to this interval. |
Interval |
addMonths(int i)
Adds months to this interval. |
Interval |
addSeconds(long i)
Adds seconds to this interval |
Interval |
addYears(int i)
Adds years to this interval. |
static int |
compare(Interval a,
Interval b)
Compares two Intervals. |
int |
compareTo(Object b)
Compares this object with another Interval. |
static Interval |
daysOnly(Interval i,
int day)
Only Sets the day value to the interval i |
static boolean |
equals(Interval a,
Interval b)
Compares Intervals |
boolean |
equals(Object b)
Compares this object with an object received as a parameter |
String |
format()
Formats the interval. |
String |
format(IntervalUnit from,
IntervalUnit to)
Formats the interval showing the interval units included in the from/to range. |
static Interval |
fromMinutes(int minutes)
Constructs an interval from a number of minutes |
static Interval |
fromSeconds(int seconds)
Constructs an interval from a number of seconds |
long |
get(IntervalUnit field)
|
double |
getAproximateTotal(IntervalUnit field)
|
int |
getDays()
The "days" value for this interval. |
int |
getDaysOnly()
The "days" value for this interval. |
static String |
getFieldName(IntervalUnit field)
|
int |
getHours()
The "hours" value for this interval. |
int |
getHoursOnly()
The "hours" value for this interval. |
long |
getMicroSeconds()
Hour portion of the interval reexpressed into microseconds. |
int |
getMicroSecondsOnly()
The "microseconds" part of the interval. |
long |
getMilliSeconds()
Hour portion of the interval reexpressed into milliseconds. |
int |
getMilliSecondsOnly()
The "milliseconds" part of the interval. |
int |
getMinutes()
Hour portion of the interval reexpressed into minutes. |
int |
getMinutesOnly()
The "minutes" value of the interval. |
int |
getMonths()
The "years/months" value for this interval expressed in months. |
int |
getMonthsOnly()
The "months" value for this interval. |
long |
getOnly(IntervalUnit field)
|
int |
getSeconds()
Hour portion of the interval reexpressed into seconds. |
int |
getSecondsOnly()
The "seconds" value for this interval. |
long |
getTotalMicroseconds()
|
int |
getYears()
The "years" value for this interval. |
int |
getYearsOnly()
The "years" value for this interval. |
int |
hashCode()
Returns hash code |
static Interval |
hoursOnly(Interval i,
int hour)
Sets only the hours value to an Interval object |
int |
intValue()
Number of seconds that the interval represents |
static void |
main(String[] args)
|
Interval |
max(Interval b)
Compares this object with the argument and returns the higher. |
static Interval |
microSecondsOnly(Interval i,
long microSecond)
Sets only the microsecond value to an Interval object |
static Interval |
milliSecondsOnly(Interval i,
long milliSecond)
Sets only the milliseconds value to an Interval object |
Interval |
min(Interval b)
Compares this object with the argument and returns the lower. |
static Interval |
minutesOnly(Interval i,
int minute)
Sets only the minute value to an Interval object |
static Interval |
monthsOnly(Interval i,
int month)
Sets only the month value to an Interval object |
Interval |
negate()
Returns a Interval whose value is (-this). |
static Interval |
negate(Interval op)
Returns the value of the interval with the sign changed. |
static Interval |
parseInterval(String t)
Parses an interval. |
String |
retryIn()
Deprecated. Maintained for backwards compatibility |
static Interval |
secondsOnly(Interval i,
int second)
|
Interval |
set(IntervalUnit field,
long value)
|
Interval |
setOnly(IntervalUnit field,
long value)
|
void |
sleep()
Causes the current execution to sleep for the milliseconds value of this object. |
Interval |
sub(Interval t)
Substracts an Interval. |
static Interval |
sub(Interval op1,
Interval op2)
Substracts two Intervals |
Time |
subFrom(Time t)
Substract from a Time. |
String |
toString()
Returns a string representation of an interval value |
String |
toXMLString()
Returns an XML string representation of an interval value |
static Interval |
valueOf(BigDecimal ms)
Constructs an interval from a number of microseconds. |
static Interval |
valueOf(double ms)
Constructs an interval from a number of microseconds (from a double) |
static Interval |
valueOf(int months,
int days,
long microSeconds)
Constructs an interval from a number of months, days and microseconds |
static Interval |
valueOf(long microSeconds)
Constructs an interval from a number of microseconds (from a long) |
static Interval |
valueOf(Object obj)
Constructs an interval from another Object (eg: Interval, Time, Number or String). |
static Interval |
valueOf(String t)
Parses a string with one of the following formats: -? {tmspec}+ -? {num}:{num}(:{num}(.{num})?)? Where {tmspec} is one of: {num}{ws}*M --> months {num}{ws}*d --> days {num}{ws}*h --> hours {num}{ws}*m --> minutes {num}{ws}*s --> seconds and {num} is a number with an optional decimal part For example: 1M10d2s --> 1 month, 10 days, 2 seconds 10 d 2.5 m --> 10 days, 2 minutes, 30 seconds 365.25d 10h 3s 3.5s --> 365 days, 16 hours, 6 seconds, 500000 microseconds 10 d 2.5 --> IntervalFormatException |
static Interval |
valueOf(Time i)
Constructs an interval from a Time object. |
static Interval |
valueOf(Time op1,
Time op2)
Returns the subtraction between two Times as an Interval object |
static Interval |
yearsOnly(Interval i,
int year)
Sets only the year value to an Interval object |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Interval ZERO
public static final Interval ONE_SECOND
public static final Interval ONE_MINUTE
public static final Interval ONE_HOUR
public static final Interval ONE_DAY
public static final Interval ONE_WEEK
public static final Interval ONE_MONTH
| Constructor Detail |
public Interval()
| Method Detail |
public static int compare(Interval a,
Interval b)
a - Interval first Interval to be compared.b - Interval second Interval to be compared.
public static Interval daysOnly(Interval i,
int day)
i - Interval The interval to be setday - int Value of day
public static boolean equals(Interval a,
Interval b)
a - an object to compare.b - an object to compare.
public static Interval add(Interval op1,
Interval op2)
op1 - The first intervalop2 - The second interval
public static Interval hoursOnly(Interval i,
int hour)
i - Interval The Interval objecthour - int Hour value to be assigned.
public static Interval microSecondsOnly(Interval i,
long microSecond)
i - Interval The Interval objectmicroSecond - long Microsecond value to be assigned.
public static Interval milliSecondsOnly(Interval i,
long milliSecond)
i - Interval The Interval objectmilliSecond - long Milliseconds value to be assigned.
public static Interval minutesOnly(Interval i,
int minute)
i - Interval The Interval objectminute - int Minute value to be assigned.
public static Interval monthsOnly(Interval i,
int month)
i - Interval The Interval objectmonth - int Month value to be assigned.
public static Interval sub(Interval op1,
Interval op2)
op1 - The first operandop2 - The second operand
public static Interval secondsOnly(Interval i,
int second)
public static Interval parseInterval(String t)
throws IntervalFormatException
fuego.lang.IntervalFormatException
IntervalFormatExceptionpublic static Interval valueOf(Time i)
i - Time The object .public static Interval valueOf(Object obj)
obj - The object.
public static Interval valueOf(int months,
int days,
long microSeconds)
months - The number of months, can be negative.days - The number of days, can be negative.microSeconds - The number of microseconds, can be negative.
public static Interval valueOf(String t)
throws IntervalFormatException
t - The string to parse
fuego.lang.IntervalFormatException
IntervalFormatExceptionpublic static String getFieldName(IntervalUnit field)
public static void main(String[] args)
public static Interval negate(Interval op)
public static Interval valueOf(Time op1,
Time op2)
op1 - First Time object.op2 - Second Time object.public static Interval valueOf(BigDecimal ms)
ms - The number of microseconds, can be negative.public static Interval valueOf(double ms)
ms - The number of microseconds, can be negative.public static Interval valueOf(long microSeconds)
microSeconds - The number of microseconds, can be negative.public static Interval fromMinutes(int minutes)
minutes - The number of minutes, can be negative.public static Interval fromSeconds(int seconds)
seconds - The number of seconds, can be negative.
public static Interval yearsOnly(Interval i,
int year)
public int getDays()
public int getDaysOnly()
public int getHours()
public int getHoursOnly()
public long getMicroSeconds()
public int getMicroSecondsOnly()
public long getMilliSeconds()
public int getMilliSecondsOnly()
public int getMinutes()
public int getMinutesOnly()
public int getSeconds()
public int getMonthsOnly()
public int getSecondsOnly()
public int getMonths()
public int getYears()
public int getYearsOnly()
public Interval abs()
public Interval addDays(int i)
i - Days to add (can be negative)public Interval addHours(long i)
i - Hours to add (can be negative)public Interval addMinutes(long i)
i - Minutes to add (can be negative)public Interval addMonths(int i)
i - Months to add (can be negative)public Interval addYears(int i)
i - Years to add (can be negative)public int compareTo(Object b)
compareTo in interface Comparableb - the Interval to be compared.public boolean equals(Object b)
b - an object to compare to.
public Time add(Time t)
t - The Time to add.public double getAproximateTotal(IntervalUnit field)
public long getOnly(IntervalUnit field)
public long getTotalMicroseconds()
public long get(IntervalUnit field)
public int hashCode()
public Interval max(Interval b)
b - Interval The argument to compare with this object
public Interval setOnly(IntervalUnit field,
long value)
public Interval min(Interval b)
b - Interval The argument to compare with this objectpublic Interval negate()
public Interval add(Interval t)
t - The interval to add.public Interval sub(Interval t)
t - The interval to be substracted.public Time subFrom(Time t)
t - The Time to be substracted from.public Interval addMicroSeconds(long i)
i - Micro-seconds to add (can be negative)public Interval addSeconds(long i)
i - Seconds to add (can be negative)
public String format(IntervalUnit from,
IntervalUnit to)
from - IntervalUnit to format the interval fromto - IntervalUnit to format the interval to
public String format()
public int intValue()
public String retryIn()
public Interval set(IntervalUnit field,
long value)
public String toString()
public String toXMLString()
public void sleep()
throws InterruptedException
InterruptedException
|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||