com.espertech.esper.client.time
Class CurrentTimeSpanEvent

java.lang.Object
  extended by com.espertech.esper.client.time.TimerEvent
      extended by com.espertech.esper.client.time.CurrentTimeSpanEvent
All Implemented Interfaces:
java.io.Serializable

public final class CurrentTimeSpanEvent
extends TimerEvent
implements java.io.Serializable

Event for externally controlling the time within an 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.

See Also:
Serialized Form

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentTimeSpanEvent

public CurrentTimeSpanEvent(long targetTimeInMillis)
Constructor taking only a target time to advance to.

Use this constructor to have the engine decide the resolution at which time advances, according to present statement schedules.

Parameters:
targetTimeInMillis - target time

CurrentTimeSpanEvent

public CurrentTimeSpanEvent(long targetTimeInMillis,
                            long optionalResolution)
Constructor taking a target time to advance to and a resoultion to use to advance time.

Use this constructor to dictate a resolution at which time advances.

Parameters:
targetTimeInMillis - target time
optionalResolution - should be a positive value
Method Detail

getTargetTimeInMillis

public long getTargetTimeInMillis()
Returns the target time to advance engine time to.

Returns:
target time

setTargetTimeInMillis

public void setTargetTimeInMillis(long targetTimeInMillis)
Sets the target time to advance engine time to.

Parameters:
targetTimeInMillis - target time

getOptionalResolution

public java.lang.Long getOptionalResolution()
Returns the resolution for advancing time, or null if none provided.

Returns:
resolution

setOptionalResolution

public void setOptionalResolution(java.lang.Long optionalResolution)
Sets the resolution for advancing time, or provide a null value if no resolution is desired.

Parameters:
optionalResolution - resolution

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com