flux
Interface Cron

All Superinterfaces:
CronSlice, java.io.Serializable, TimeExpression
All Known Subinterfaces:
CronForLoop, CronOr

public interface Cron
extends CronSlice, TimeExpression

Represents a time specification in the traditional Cron style.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Field Summary
static java.lang.String APR
          April
static int APRIL
          April
static java.lang.String AUG
          August
static int AUGUST
          August
static java.lang.String DEC
          December
static int DECEMBER
          December
static java.lang.String FEB
          February
static int FEBRUARY
          February
static java.lang.String FRI
          Friday
static int FRIDAY
          Friday
static java.lang.String JAN
          January
static int JANUARY
          January
static java.lang.String JUL
          July
static int JULY
          July
static java.lang.String JUN
          June
static int JUNE
          June
static java.lang.String MAR
          March
static int MARCH
          March
static int MAY_INT
          May
static java.lang.String MAY_STRING
          May
static java.lang.String MON
          Monday
static int MONDAY
          Monday
static java.lang.String NOV
          November
static int NOVEMBER
          November
static java.lang.String OCT
          October
static int OCTOBER
          October
static java.lang.String SAT
          Saturday
static int SATURDAY
          Saturday
static java.lang.String SEP
          September
static int SEPTEMBER
          September
static java.lang.String SUN
          Sunday
static int SUNDAY
          Sunday
static java.lang.String THU
          Thursday
static int THURSDAY
          Thursday
static java.lang.String TUE
          Tuesday
static int TUESDAY
          Tuesday
static java.lang.String WED
          Wednesday
static int WEDNESDAY
          Wednesday
 
Method Summary
 boolean isCronForLoop()
          Returns true only if this Cron object is a Cron "for" loop.
 boolean isCronOr()
          Returns true only if this Cron object is a Cron "or".
 boolean isRegularCron()
          Returns true only if this Cron object is not a Cron "for" loop and is not a Cron "or".
 java.util.Date previous()
          Returns the previous date that satisfies the constraints of this Time Expression.
 java.util.Date previous(java.util.Date before)
          Returns the previous date that satisfies the constraints of this Time Expression; the previous date comes strictly before the specified date.
 java.lang.String toString()
          Converts the Cron-style Time Expression to string form, which can then be submitted to the engine as a Time Expression.
 
Methods inherited from interface flux.CronSlice
add, add, add, add, add, add, addAll, addAll, get, getEndingCronColumn, getStartingCronColumn, includesAllValues
 
Methods inherited from interface flux.TimeExpression
accept, getBusinessInterval, getTimeZone, next, next, reset, setBusinessInterval, setTimeZone
 

Field Detail

SUNDAY

static final int SUNDAY
Sunday

See Also:
Constant Field Values

MONDAY

static final int MONDAY
Monday

See Also:
Constant Field Values

TUESDAY

static final int TUESDAY
Tuesday

See Also:
Constant Field Values

WEDNESDAY

static final int WEDNESDAY
Wednesday

See Also:
Constant Field Values

THURSDAY

static final int THURSDAY
Thursday

See Also:
Constant Field Values

FRIDAY

static final int FRIDAY
Friday

See Also:
Constant Field Values

SATURDAY

static final int SATURDAY
Saturday

See Also:
Constant Field Values

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

JANUARY

static final int JANUARY
January

See Also:
Constant Field Values

FEBRUARY

static final int FEBRUARY
February

See Also:
Constant Field Values

MARCH

static final int MARCH
March

See Also:
Constant Field Values

APRIL

static final int APRIL
April

See Also:
Constant Field Values

MAY_INT

static final int MAY_INT
May

See Also:
Constant Field Values

JUNE

static final int JUNE
June

See Also:
Constant Field Values

JULY

static final int JULY
July

See Also:
Constant Field Values

AUGUST

static final int AUGUST
August

See Also:
Constant Field Values

SEPTEMBER

static final int SEPTEMBER
September

See Also:
Constant Field Values

OCTOBER

static final int OCTOBER
October

See Also:
Constant Field Values

NOVEMBER

static final int NOVEMBER
November

See Also:
Constant Field Values

DECEMBER

static final int DECEMBER
December

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_STRING

static final java.lang.String MAY_STRING
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
Method Detail

isCronForLoop

boolean isCronForLoop()
Returns true only if this Cron object is a Cron "for" loop.

Returns:
True only if this Cron object is a Cron "for" loop.

isCronOr

boolean isCronOr()
Returns true only if this Cron object is a Cron "or".

Returns:
True only if this Cron object is a Cron "or".

isRegularCron

boolean isRegularCron()
Returns true only if this Cron object is not a Cron "for" loop and is not a Cron "or".

Returns:
True only if this Cron object is not a Cron "for" loop and is not a Cron "or".

previous

java.util.Date previous()
                        throws EngineException
Returns the previous date that satisfies the constraints of this Time Expression. The first time previous() or next() is called, it will generate a date relative to the current time. However, on subsequent calls to previous() and next(), this method generates a date relative to the date last returned by previous() or next().

For example, consider the following code.

 Date d1 = myTimeExpression.previous();
 Date d2 = myTimeExpression.previous();
 
In the above code, the first call evaluates a Time Expression relative to the current time. The result is stored in d1. The second call evaluates a Time Expression relative to d1 and stores the result in d2.

Returns:
The previous date that satisfies the constraints of this Time Expression.
Throws:
EngineException - if the time expression does not evaluate correctly.

previous

java.util.Date previous(java.util.Date before)
                        throws EngineException
Returns the previous date that satisfies the constraints of this Time Expression; the previous date comes strictly before the specified date. When this method is called, it will generate a date relative to the specified date.

For example, consider the following code.

 Date d2 = myTimeExpression.previous(d1);
 Date d3 = myTimeExpression.previous();
 
In the above code, the first call evaluates a Time Expression relative to d1. The result is stored in d2. The second call evaluates a Time Expression relative to d2 and stores the result in d3.

Parameters:
before - The result is strictly before this date.
Returns:
The previous date that satisfies the constraints of this Time Expression.
Throws:
EngineException - if the time expression does not evaluate correctly.

toString

java.lang.String toString()
Converts the Cron-style Time Expression to string form, which can then be submitted to the engine as a Time Expression.

Overrides:
toString in class java.lang.Object
Returns:
The Cron-style Time Expression in string form.


© 2014 Flux Corporation. All rights reserved.