java.lang.Object
org.bzdev.scripting.ScriptListenerAdapter
org.bzdev.bikeshare.HubDataAdapter
- All Implemented Interfaces:
EventListener
,HubDataListener
Adapter for hub-data listeners.
This class provides a default implementation for the method
specified by HubDataListener 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 method is provided by a
scripting-language object with a method that has the same names as
the method defined by 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.HubDataAdapter
(ScriptingContext sc, Object scriptObject) Constructor given a scripting context and script object.HubDataAdapter
(ExpressionParser.ESPObject scriptObject) Constructor with only a script object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
hubChanged
(Hub hub, int bikeCount, boolean newBikeCount, int overflowCount, boolean newOverflowCount, double time, long ticks) Notify this listener that a hub's counts changed.Methods inherited from class org.bzdev.scripting.ScriptListenerAdapter
callScriptMethod
-
Constructor Details
-
HubDataAdapter
public HubDataAdapter()Constructor. -
HubDataAdapter
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
HubDataAdapter(ScriptingContext,Object)
with a null first argument.- Parameters:
scriptObject
- the scripting-language object implementing the listener interface for this adapter.
-
HubDataAdapter
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