java.lang.Object
org.bzdev.scripting.ScriptListenerAdapter
org.bzdev.bikeshare.TripDataAdapter
- All Implemented Interfaces:
TripDataListener
Adapter for trip-data listeners.
This class provides default implementations for the
methods specified by TripDataListener and allows the
listener to be implemented in a scripting language.
For use in Java code, one should override the methods of
this class. For use in a scripting environment, the
implementation of the methods is provided by a scripting-language
object whose methods include ones that the same names as the methods of
this class. If a method is missing, the call will succeed but no
action will be performed.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.scripting.ScriptListenerAdapter
ScriptListenerAdapter.ScriptMethodException
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.TripDataAdapter
(ScriptingContext sc, Object scriptObject) Constructor given a scripting context and script object.TripDataAdapter
(ExpressionParser.ESPObject scriptObject) Constructor with only a script object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Indicate that a trip has ended.void
tripFailedAtStart
(long tripID, double time, long ticks, Hub hub) Indicate that a trip has failed to start.void
tripFailedMidstream
(long tripID, double time, long ticks, Hub hub) Indicate that a trip has failed to complete.void
tripPauseEnd
(long tripID, double time, long ticks, Hub hub, HubDomain d) Indicates that the end of an interval during which a trip paused at an intermediate hub.void
tripPauseStart
(long tripID, double time, long ticks, Hub hub) Indicates that the start of an interval during which a trip paused at an intermediate hub.void
tripStarted
(long tripID, double time, long ticks, Hub hub, HubDomain d) Indicate that a trip has started.Methods inherited from class org.bzdev.scripting.ScriptListenerAdapter
callScriptMethod
-
Constructor Details
-
TripDataAdapter
public TripDataAdapter()Constructor. -
TripDataAdapter
Constructor with only a script object. This creates an adapter for use with the ESP scripting language.Note: This is equivalent to using the constructor
TripDataAdapter(ScriptingContext,Object)
with a null first argument.- Parameters:
scriptObject
- the scripting-language object implementing the listener interface for this adapter.
-
TripDataAdapter
Constructor given a scripting context and script object.- Parameters:
sc
- the scripting context for this adapterscriptObject
- the scripting-language object implementing the listener interface for this adapter.
-
-
Method Details