public final class CurrentTimeSpanEvent extends TimerEvent implements Serializable
EPRuntime
or EPRuntimeIsolated
instance,
advancing time over a span of time.
The engine advances time according to the resolution passed in, completing at the target time provided.
When used without a resolution or with a negative or zero value for resolution the engine advances time according to any statement schedules that may be present. If no statement schedules are present, the engine simply advances time to the target time provided.
External clocking must be enabled via TimerControlEvent
before this class can be used
to externally feed time.
Constructor and Description |
---|
CurrentTimeSpanEvent(long targetTime)
Constructor taking only a target time to advance to.
|
CurrentTimeSpanEvent(long targetTime,
long optionalResolution)
Constructor taking a target time to advance to and a resoultion to use to advance time.
|
Modifier and Type | Method and Description |
---|---|
Long |
getOptionalResolution()
Returns the resolution for advancing time, or null if none provided.
|
long |
getTargetTime()
Returns the target time to advance engine time to.
|
void |
setOptionalResolution(Long optionalResolution)
Sets the resolution for advancing time, or provide a null value if no resolution is desired.
|
void |
setTargetTime(long targetTime)
Sets the target time to advance engine time to.
|
public CurrentTimeSpanEvent(long targetTime)
Use this constructor to have the engine decide the resolution at which time advances, according to present statement schedules.
targetTime
- target timepublic CurrentTimeSpanEvent(long targetTime, long optionalResolution)
Use this constructor to dictate a resolution at which time advances.
targetTime
- target timeoptionalResolution
- should be a positive valuepublic long getTargetTime()
public void setTargetTime(long targetTime)
targetTime
- target timepublic Long getOptionalResolution()
public void setOptionalResolution(Long optionalResolution)
optionalResolution
- resolution