Interface SimpleEventProvider<E>

Type Parameters:
E - 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 SimpleEventProvider<E>
Generic simple event provider with empty default implementation. Implementing this interface in a class allows mapping raw event values to simple events. Each implementation is responsible for actually triggering the simple events within dispatchSimpleEvents(Object).
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Analyzes the given value passed by an event and triggers 0-n simple events based on it.
  • Method Details

    • dispatchSimpleEvents

      default void dispatchSimpleEvents(E value)
      Analyzes the given value passed by an event and triggers 0-n simple events based on it. This method allows mapping various value/state changes to simple events. Must be attached using DigitalEventProvider.addListener(EventHandler).
      Parameters:
      value - Event value