edu.cmu.emulator.world
Class RSALInfo
java.lang.Object
edu.cmu.emulator.listener.ListenerInfo
edu.cmu.emulator.world.RSALInfo
public class RSALInfo
- extends ListenerInfo
Holds information about each listener registered to the RelSpatialAttribute.
Keeps track of the previous time at which the listener was invoked
and also performs the necessary calculations to check if the listener
should be invoked or not based on the listener's invocation frequency.
Invocations may also occur due to a change in some magnitude, such
as movement distance that the listener is interested in.
- See Also:
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
triggerIntervalMillis
protected long triggerIntervalMillis
prevRelValue
protected Object prevRelValue
prevAbsValue
protected Object prevAbsValue
prevTime
protected long prevTime
triggerMagnitude
protected double triggerMagnitude
triggerOnRelativeChange
protected boolean triggerOnRelativeChange
triggerOnAbsoluteChange
protected boolean triggerOnAbsoluteChange
NO_INTERVAL
public static final long NO_INTERVAL
- See Also:
- Constant Field Values
NO_MAGNITUDE
public static final double NO_MAGNITUDE
- See Also:
- Constant Field Values
RELATIVE
public static final int RELATIVE
- See Also:
- Constant Field Values
ABSOLUTE
public static final int ABSOLUTE
- See Also:
- Constant Field Values
debug
private static final boolean debug
- See Also:
- Constant Field Values
debugListeners
private static final boolean debugListeners
- See Also:
- Constant Field Values
RSALInfo
public RSALInfo(RSAListener listener)
RSALInfo
public RSALInfo(RSAListener listener,
int threadMode)
triggerOnAbsolute
public boolean triggerOnAbsolute()
triggerOnRelative
public boolean triggerOnRelative()
setTriggerInterval
public void setTriggerInterval(double triggerIntervalSecs)
setTriggerInterval
public void setTriggerInterval(long triggerIntervalMillis)
getTriggerIntervalMillis
public long getTriggerIntervalMillis()
setTriggerMagnitude
public void setTriggerMagnitude(double triggerMagnitude,
int relAbsMode)
getTriggerMagnitude
public double getTriggerMagnitude()
triggerIntervalExceeded
protected boolean triggerIntervalExceeded(long timeMillis)
triggerMagnitudeExceeded
protected boolean triggerMagnitudeExceeded(long magnitude)
checkForTrigger
public Object checkForTrigger(Object source,
long timeMillis,
Object relValue)
- Description copied from class:
ListenerInfo
- may be called from multiple threads, so writing state should be avoided
- Overrides:
checkForTrigger
in class ListenerInfo
doUpdate
public void doUpdate(Object source,
long timeMillis,
Object updateValue)
- Specified by:
doUpdate
in class ListenerInfo
Copyright © 2013. All Rights Reserved.