flux
Interface Relative

All Superinterfaces:
java.io.Serializable, TimeExpression

public interface Relative
extends TimeExpression

Represents a relative time specification.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

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

SUN

static final java.lang.String SUN
Sunday

See Also:
Constant Field Values

MON

static final java.lang.String MON
Monday

See Also:
Constant Field Values

TUE

static final java.lang.String TUE
Tuesday

See Also:
Constant Field Values

WED

static final java.lang.String WED
Wednesday

See Also:
Constant Field Values

THU

static final java.lang.String THU
Thursday

See Also:
Constant Field Values

FRI

static final java.lang.String FRI
Friday

See Also:
Constant Field Values

SAT

static final java.lang.String SAT
Saturday

See Also:
Constant Field Values

JAN

static final java.lang.String JAN
January

See Also:
Constant Field Values

FEB

static final java.lang.String FEB
February

See Also:
Constant Field Values

MAR

static final java.lang.String MAR
March

See Also:
Constant Field Values

APR

static final java.lang.String APR
April

See Also:
Constant Field Values

MAY

static final java.lang.String MAY
May

See Also:
Constant Field Values

JUN

static final java.lang.String JUN
June

See Also:
Constant Field Values

JUL

static final java.lang.String JUL
July

See Also:
Constant Field Values

AUG

static final java.lang.String AUG
August

See Also:
Constant Field Values

SEP

static final java.lang.String SEP
September

See Also:
Constant Field Values

OCT

static final java.lang.String OCT
October

See Also:
Constant Field Values

NOV

static final java.lang.String NOV
November

See Also:
Constant Field Values

DEC

static final java.lang.String DEC
December

See Also:
Constant Field Values

YEAR

static final java.lang.String YEAR
year

See Also:
Constant Field Values

MONTH

static final java.lang.String MONTH
month

See Also:
Constant Field Values

WEEK

static final java.lang.String WEEK
week

See Also:
Constant Field Values

DAY

static final java.lang.String DAY
day

See Also:
Constant Field Values

HOUR

static final java.lang.String HOUR
hour

See Also:
Constant Field Values

MINUTE

static final java.lang.String MINUTE
minute

See Also:
Constant Field Values

SECOND

static final java.lang.String SECOND
second

See Also:
Constant Field Values

MILLISECOND

static final java.lang.String MILLISECOND
millisecond

See Also:
Constant Field Values

HOLIDAY

static final java.lang.String HOLIDAY
holiday

See Also:
Constant Field Values

NON_HOLIDAY

static final java.lang.String NON_HOLIDAY
non-holiday

See Also:
Constant Field Values

WEEKDAY

static final java.lang.String WEEKDAY
weekday

See Also:
Constant Field Values

WEEKEND_DAY

static final java.lang.String WEEKEND_DAY
weekend day

See Also:
Constant Field Values

BUSINESS_DAY

static final java.lang.String BUSINESS_DAY
business day

See Also:
Constant Field Values
Method Detail

acceptRelativeString

void acceptRelativeString(java.lang.String fromString)
                          throws EngineException
Accepts a time expression in the format output by the toString() method.

Parameters:
fromString - a string in the relative time expression format. Strings returned from #toString may be passed directly into this method.
Throws:
EngineException - If a system error occurs.

add

void add(int amount,
         java.lang.String timeUnit)
Appends "+ <amount> <timeUnit>" to the relative time expression.

Parameters:
amount - >= 1
timeUnit - a time unit between year and millisecond

add

void add(java.lang.String timeUnit)
Appends "+ <timeUnit>" to the relative time expression.

Parameters:
timeUnit - a time unit between year and millisecond

advance

void advance(int amount,
             java.lang.String dayMonthUnit)
Appends "> <amount> <dayMonthUnit>" to the relative time expression.

Parameters:
amount - >= 1
dayMonthUnit - a day/month unit in Monday-Sunday or January-December

advance

void advance(java.lang.String dayMonthUnit)
Appends "> <dayMonthUnit>" to the relative time expression.

Parameters:
dayMonthUnit - a day/month unit in Monday-Sunday or January-December

evaluate

void evaluate(java.lang.String unit,
              TimeExpression then,
              TimeExpression els)
Appends "?unit{then}{else}" to the relative time expression.

Parameters:
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.

get

java.util.List get()
Returns a sorted set of elements representing the included values of this Relative time expression. Each item in the list is one element from this Relative time expression. These elements appear in the same order as they appear in the Relative time expression.

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}"

Returns:
List of String. A sorted set of elements representing the included values of this Relative time expression.

gotoBeginning

void gotoBeginning(java.lang.String timeUnit)
Appends "^ <timeUnit>" to the relative time expression.

Parameters:
timeUnit - a time unit between year and millisecond

gotoDay

void gotoDay(int number,
             java.lang.String day)
Appends "@ <number> <day>" to the relative time expression.

Parameters:
number - >= 1 and <= 5
day - A day between Monday and Sunday

gotoDay

void gotoDay(java.lang.String day)
Appends "@ <day>" to the relative time expression.

Parameters:
day - A day between Monday and Sunday

gotoDayOfMonth

void gotoDayOfMonth(int day)
Appends "@#d" to the relative time expression, where # is the day to go to.

Parameters:
day - a day between 1 and the last day of the month.

gotoDayOfMonth

void gotoDayOfMonth()
Appends "@d" to the relative time expression.


gotoEnd

void gotoEnd(java.lang.String timeUnit)
Appends "$ <timeUnit>" to the relative time expression.

Parameters:
timeUnit - a time unit between year and millisecond

gotoHour

void gotoHour(int hour)
Appends "@#H" to the relative time expression, where # is the hour of the day to go to.

Parameters:
hour - hour of day between 0 and 23.

gotoHour

void gotoHour()
Appends "@H" to the relative time expression.


gotoLastDay

void gotoLastDay(java.lang.String day)
Appends "@!<day>" to the relative time expression.

Parameters:
day - A day between Monday and Sunday

gotoMillisecond

void gotoMillisecond(int ms)
Appends "@#S" to the relative time expression, where # is the millisecond of the second to go to.

Parameters:
ms - a millisecond of the second betwee 0 and 999.

gotoMillisecond

void gotoMillisecond()
Appends "@S" to the relative time expression.


gotoMinute

void gotoMinute(int minute)
Appends "@#m" to the relative time expression, where # is the minute of the hour to go to.

Parameters:
minute - a minute of the hour between 0 and 59.

gotoMinute

void gotoMinute()
Appends "@m" to the relative time expression.


gotoMonthOfYear

void gotoMonthOfYear(int month)
Appends "@#M" to the relative time expression, where # is the month of the year to go to.

Parameters:
month - a month of the year between 0 and 11.

gotoMonthOfYear

void gotoMonthOfYear()
Appends "@M" to the relative time expression.


gotoSecond

void gotoSecond(int second)
Appends "@#s" to the relative time expression, where # is the second of the minute to go to.

Parameters:
second - of the minute between 0 and 59.

gotoSecond

void gotoSecond()
Appends "@s" to the relative time expression.


gotoYear

void gotoYear(int year)
Appends "@ <year> y" to the relative time expression.

Parameters:
year - >= 1

retreat

void retreat(int amount,
             java.lang.String dayMonthUnit)
Appends "< <amount> <dayMonthUnit>" to the relative time expression.

Parameters:
amount - >= 1
dayMonthUnit - a day/month unit in Monday-Sunday or January-December

retreat

void retreat(java.lang.String dayMonthUnit)
Appends "< <dayMonthUnit>" to the relative time expression.

Parameters:
dayMonthUnit - a day/month unit in Monday-Sunday or January-December

subtract

void subtract(int amount,
              java.lang.String timeUnit)
Appends "- <amount> <timeUnit>" to the relative time expression.

Parameters:
amount - >= 1
timeUnit - a time unit between year and millisecond

subtract

void subtract(java.lang.String timeUnit)
Appends "- <unit>" to the relative time expression.

Parameters:
timeUnit - a time unit between year and millisecond


© 2014 Flux Corporation. All rights reserved.