public final class CurrentTimeSpanEvent extends TimerEvent implements java.io.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 targetTimeInMillis)
Constructor taking only a target time to advance to.
|
CurrentTimeSpanEvent(long targetTimeInMillis,
long optionalResolution)
Constructor taking a target time to advance to and a resoultion to use to advance time.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
getOptionalResolution()
Returns the resolution for advancing time, or null if none provided.
|
long |
getTargetTimeInMillis()
Returns the target time to advance engine time to.
|
void |
setOptionalResolution(java.lang.Long optionalResolution)
Sets the resolution for advancing time, or provide a null value if no resolution is desired.
|
void |
setTargetTimeInMillis(long targetTimeInMillis)
Sets the target time to advance engine time to.
|
public CurrentTimeSpanEvent(long targetTimeInMillis)
Use this constructor to have the engine decide the resolution at which time advances, according to present statement schedules.
targetTimeInMillis
- target timepublic CurrentTimeSpanEvent(long targetTimeInMillis, long optionalResolution)
Use this constructor to dictate a resolution at which time advances.
targetTimeInMillis
- target timeoptionalResolution
- should be a positive valuepublic long getTargetTimeInMillis()
public void setTargetTimeInMillis(long targetTimeInMillis)
targetTimeInMillis
- target timepublic java.lang.Long getOptionalResolution()
public void setOptionalResolution(java.lang.Long optionalResolution)
optionalResolution
- resolution