|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Relative
Represents a relative time specification.
Field Summary | |
---|---|
static java.lang.String |
APR
April |
static java.lang.String |
AUG
August |
static java.lang.String |
BUSINESS_DAY
business day |
static java.lang.String |
DAY
day |
static java.lang.String |
DEC
December |
static java.lang.String |
FEB
February |
static java.lang.String |
FRI
Friday |
static java.lang.String |
HOLIDAY
holiday |
static java.lang.String |
HOUR
hour |
static java.lang.String |
JAN
January |
static java.lang.String |
JUL
July |
static java.lang.String |
JUN
June |
static java.lang.String |
MAR
March |
static java.lang.String |
MAY
May |
static java.lang.String |
MILLISECOND
millisecond |
static java.lang.String |
MINUTE
minute |
static java.lang.String |
MON
Monday |
static java.lang.String |
MONTH
month |
static java.lang.String |
NON_HOLIDAY
non-holiday |
static java.lang.String |
NOV
November |
static java.lang.String |
OCT
October |
static java.lang.String |
SAT
Saturday |
static java.lang.String |
SECOND
second |
static java.lang.String |
SEP
September |
static java.lang.String |
SUN
Sunday |
static java.lang.String |
THU
Thursday |
static java.lang.String |
TUE
Tuesday |
static java.lang.String |
WED
Wednesday |
static java.lang.String |
WEEK
week |
static java.lang.String |
WEEKDAY
weekday |
static java.lang.String |
WEEKEND_DAY
weekend day |
static java.lang.String |
YEAR
year |
Method Summary | |
---|---|
void |
acceptRelativeString(java.lang.String fromString)
Accepts a time expression in the format output by the toString() method. |
void |
add(int amount,
java.lang.String timeUnit)
Appends "+ <amount> <timeUnit>" to the relative time expression. |
void |
add(java.lang.String timeUnit)
Appends "+ <timeUnit>" to the relative time expression. |
void |
advance(int amount,
java.lang.String dayMonthUnit)
Appends "> <amount> <dayMonthUnit>" to the relative time expression. |
void |
advance(java.lang.String dayMonthUnit)
Appends "> <dayMonthUnit>" to the relative time expression. |
void |
evaluate(java.lang.String unit,
TimeExpression then,
TimeExpression els)
Appends "?unit{then}{else}" to the relative time expression. |
java.util.List |
get()
Returns a sorted set of elements representing the included values of this Relative time expression. |
void |
gotoBeginning(java.lang.String timeUnit)
Appends "^ <timeUnit>" to the relative time expression. |
void |
gotoDay(int number,
java.lang.String day)
Appends "@ <number> <day>" to the relative time expression. |
void |
gotoDay(java.lang.String day)
Appends "@ <day>" to the relative time expression. |
void |
gotoDayOfMonth()
Appends "@d" to the relative time expression. |
void |
gotoDayOfMonth(int day)
Appends "@#d" to the relative time expression, where # is the day to go to. |
void |
gotoEnd(java.lang.String timeUnit)
Appends "$ <timeUnit>" to the relative time expression. |
void |
gotoHour()
Appends "@H" to the relative time expression. |
void |
gotoHour(int hour)
Appends "@#H" to the relative time expression, where # is the hour of the day to go to. |
void |
gotoLastDay(java.lang.String day)
Appends "@!<day>" to the relative time expression. |
void |
gotoMillisecond()
Appends "@S" to the relative time expression. |
void |
gotoMillisecond(int ms)
Appends "@#S" to the relative time expression, where # is the millisecond of the second to go to. |
void |
gotoMinute()
Appends "@m" to the relative time expression. |
void |
gotoMinute(int minute)
Appends "@#m" to the relative time expression, where # is the minute of the hour to go to. |
void |
gotoMonthOfYear()
Appends "@M" to the relative time expression. |
void |
gotoMonthOfYear(int month)
Appends "@#M" to the relative time expression, where # is the month of the year to go to. |
void |
gotoSecond()
Appends "@s" to the relative time expression. |
void |
gotoSecond(int second)
Appends "@#s" to the relative time expression, where # is the second of the minute to go to. |
void |
gotoYear(int year)
Appends "@ <year> y" to the relative time expression. |
void |
retreat(int amount,
java.lang.String dayMonthUnit)
Appends "< <amount> <dayMonthUnit>" to the relative time expression. |
void |
retreat(java.lang.String dayMonthUnit)
Appends "< <dayMonthUnit>" to the relative time expression. |
void |
subtract(int amount,
java.lang.String timeUnit)
Appends "- <amount> <timeUnit>" to the relative time expression. |
void |
subtract(java.lang.String timeUnit)
Appends "- <unit>" to the relative time expression. |
Methods inherited from interface flux.TimeExpression |
---|
accept, getBusinessInterval, getTimeZone, next, next, reset, setBusinessInterval, setTimeZone |
Field Detail |
---|
static final java.lang.String SUN
static final java.lang.String MON
static final java.lang.String TUE
static final java.lang.String WED
static final java.lang.String THU
static final java.lang.String FRI
static final java.lang.String SAT
static final java.lang.String JAN
static final java.lang.String FEB
static final java.lang.String MAR
static final java.lang.String APR
static final java.lang.String MAY
static final java.lang.String JUN
static final java.lang.String JUL
static final java.lang.String AUG
static final java.lang.String SEP
static final java.lang.String OCT
static final java.lang.String NOV
static final java.lang.String DEC
static final java.lang.String YEAR
static final java.lang.String MONTH
static final java.lang.String WEEK
static final java.lang.String DAY
static final java.lang.String HOUR
static final java.lang.String MINUTE
static final java.lang.String SECOND
static final java.lang.String MILLISECOND
static final java.lang.String HOLIDAY
static final java.lang.String NON_HOLIDAY
static final java.lang.String WEEKDAY
static final java.lang.String WEEKEND_DAY
static final java.lang.String BUSINESS_DAY
Method Detail |
---|
void acceptRelativeString(java.lang.String fromString) throws EngineException
fromString
- a string in the relative time expression
format. Strings returned from #toString may be passed directly into
this method.
EngineException
- If a system error occurs.void add(int amount, java.lang.String timeUnit)
amount
- >= 1timeUnit
- a time unit between year and millisecondvoid add(java.lang.String timeUnit)
timeUnit
- a time unit between year and millisecondvoid advance(int amount, java.lang.String dayMonthUnit)
amount
- >= 1dayMonthUnit
- a day/month unit in Monday-Sunday or January-Decembervoid advance(java.lang.String dayMonthUnit)
dayMonthUnit
- a day/month unit in Monday-Sunday or January-Decembervoid evaluate(java.lang.String unit, TimeExpression then, TimeExpression els)
unit
- Must be one of the following units: day-of-week,
month-of-year, business day, holiday, non-holiday, weekday, or weekend.then
- Time expression that is applied if unit clause if true. May be
null.els
- Time expression that is applied if unit clause is false. May be
null.java.util.List get()
For example, if a Relative time expression is "+3d>2b", the elements in the list would be:
[0] = "+3d"
[1] = ">2b"
As a more complex example, if a Relative time expression includes a conditional operator, such as "+3d>2b?tue{+d>tue}{-y}", then the output of this method would be:
[0] = "+3d"
[1] = ">2b"
[2] = "?tue{+d>tue}{-y}"
Similarly, for the conditional Relative time expression "?tue{+d>tue}{-y}", the output of this method would simply be:
[0] = "?tue{+d>tue}{-y}"
void gotoBeginning(java.lang.String timeUnit)
timeUnit
- a time unit between year and millisecondvoid gotoDay(int number, java.lang.String day)
number
- >= 1 and <= 5day
- A day between Monday and Sundayvoid gotoDay(java.lang.String day)
day
- A day between Monday and Sundayvoid gotoDayOfMonth(int day)
day
- a day between 1 and the last day of the month.void gotoDayOfMonth()
void gotoEnd(java.lang.String timeUnit)
timeUnit
- a time unit between year and millisecondvoid gotoHour(int hour)
hour
- hour of day between 0 and 23.void gotoHour()
void gotoLastDay(java.lang.String day)
day
- A day between Monday and Sundayvoid gotoMillisecond(int ms)
ms
- a millisecond of the second betwee 0 and 999.void gotoMillisecond()
void gotoMinute(int minute)
minute
- a minute of the hour between 0 and 59.void gotoMinute()
void gotoMonthOfYear(int month)
month
- a month of the year between 0 and 11.void gotoMonthOfYear()
void gotoSecond(int second)
second
- of the minute between 0 and 59.void gotoSecond()
void gotoYear(int year)
year
- >= 1void retreat(int amount, java.lang.String dayMonthUnit)
amount
- >= 1dayMonthUnit
- a day/month unit in Monday-Sunday or January-Decembervoid retreat(java.lang.String dayMonthUnit)
dayMonthUnit
- a day/month unit in Monday-Sunday or January-Decembervoid subtract(int amount, java.lang.String timeUnit)
amount
- >= 1timeUnit
- a time unit between year and millisecondvoid subtract(java.lang.String timeUnit)
timeUnit
- a time unit between year and millisecond
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |