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 Type
    Method
    Description
    Adds a new event listener which uses the given handler.
    void
    removeListener(L listener)
    Removes the given event listener.
  • Method Details

    • addListener

      L addListener(EventHandler<V> handler)
      Adds a new event listener which uses the given handler.
      Parameters:
      handler - Event handler to call
      Returns:
      Event listener instance
    • removeListener

      void removeListener(L listener)
      Removes the given event listener.
      Parameters:
      listener - Event listener to remove