Module com.pi4j.crowpi
Interface EventProvider<L extends EventListener,V>
- Type Parameters:
L- Type of event listener used for implementation.V- Type of value which gets passed to event handlers.
- All Known Subinterfaces:
DigitalEventProvider<V>
- All Known Implementing Classes:
ButtonComponent,PirMotionSensorComponent,SoundSensorComponent,TiltSensorComponent,TouchSensorComponent
public interface EventProvider<L extends EventListener,V>
Generic event provider interface for components which expose the ability to add or remove event listeners.
-
Method Summary
Modifier and TypeMethodDescriptionaddListener(EventHandler<V> handler) Adds a new event listener which uses the given handler.voidremoveListener(L listener) Removes the given event listener.
-
Method Details
-
addListener
Adds a new event listener which uses the given handler.- Parameters:
handler- Event handler to call- Returns:
- Event listener instance
-
removeListener
Removes the given event listener.- Parameters:
listener- Event listener to remove
-