Package org.dashbuilder.dataset.date
Class TimeFrame
- java.lang.Object
-
- org.dashbuilder.dataset.date.TimeFrame
-
public class TimeFrame extends Object
A time frame defines a time period between two time instants where these two instants depends on the current time.Some examples of time frame expressions are:
- "now till 10second" => next 10 seconds
- "begin[minute] till 10second" => first 10 seconds of current minute
- "begin[minute] till now" => past seconds within current minute
- "begin[minute] till 60seconds" => the current minute
- "now till 1year" => 1 year since now
- "now till end[year March] 1year" => this year + next (year starting on March)
- "end[year March] till 1year" => next year
- "begin[year March] -1year till now" => begin of last year till now
- "end[year March] +2quarter till 1quarter" => 3rd quarter of next year
- "begin[year March] -7day till begin[year March]" => Last week of last year
-
-
Constructor Summary
Constructors Constructor Description TimeFrame()TimeFrame(TimeInstant from, TimeInstant to)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeInstantgetFrom()TimeInstantgetTo()static TimeFrameparse(String timeFrameExpr)Parses a time frame expression.voidsetFrom(TimeInstant from)voidsetTo(TimeInstant to)StringtoString()
-
-
-
Constructor Detail
-
TimeFrame
public TimeFrame()
-
TimeFrame
public TimeFrame(TimeInstant from, TimeInstant to)
-
-
Method Detail
-
getFrom
public TimeInstant getFrom()
-
setFrom
public void setFrom(TimeInstant from)
-
getTo
public TimeInstant getTo()
-
setTo
public void setTo(TimeInstant to)
-
parse
public static TimeFrame parse(String timeFrameExpr)
Parses a time frame expression.- Parameters:
timeFrameExpr- A valid time instant expression (see TimeFrame class javadoc)- Returns:
- A TimeFrame instance
- Throws:
IllegalArgumentException- If the expression is not valid
-
-