public class TimeRelativeInterval extends Object
This class stores a reference for start and a reference for end. Each reference
can either be absolute, in which case it's a TimeStamp, or relative, in
which case it's a TimeDuration. The toAbsoluteInterval(org.diirt.util.time.Timestamp)
can be used to transform the relative interval into an absolute one
calculated from the reference. This allows to keep the relative interval,
and then to convert multiple time to an absolute interval every time
that one needs to calculate. For example, one can keep the range of a plot
from 1 minute ago to now, and then get a specific moment the absolute range
of that plot.
Modifier and Type | Method and Description |
---|---|
Timestamp |
getAbsoluteEnd() |
Timestamp |
getAbsoluteStart() |
Object |
getEnd() |
TimeDuration |
getRelativeEnd() |
TimeDuration |
getRelativeStart() |
Object |
getStart() |
boolean |
isEndAbsolute() |
boolean |
isIntervalAbsolute() |
boolean |
isStartAbsolute() |
static TimeRelativeInterval |
of(Timestamp start,
Timestamp end) |
TimeInterval |
toAbsoluteInterval(Timestamp reference) |
public static TimeRelativeInterval of(Timestamp start, Timestamp end)
public boolean isIntervalAbsolute()
public boolean isStartAbsolute()
public boolean isEndAbsolute()
public Object getStart()
public Object getEnd()
public Timestamp getAbsoluteStart()
public Timestamp getAbsoluteEnd()
public TimeDuration getRelativeStart()
public TimeDuration getRelativeEnd()
public TimeInterval toAbsoluteInterval(Timestamp reference)
Copyright © 2015. All rights reserved.