Package com.diozero.internal.spi
Class AbstractInputDevice<T extends DeviceEvent>
java.lang.Object
com.diozero.internal.spi.AbstractDevice
com.diozero.internal.spi.AbstractInputDevice<T>
- All Implemented Interfaces:
DeviceInterface
,Closeable
,AutoCloseable
- Direct Known Subclasses:
MCP23xxxDigitalInputDevice
,MCP23xxxDigitalInputOutputDevice
,NativeGpioInputDevice
,NativeGpioInputOutputDevice
,PiconZero.PiconZeroAnalogInputDevice
,SysFsAnalogInputDevice
,SysFsDigitalInputDevice
,SysFsDigitalInputOutputDevice
public abstract class AbstractInputDevice<T extends DeviceEvent> extends AbstractDevice
-
Constructor Summary
Constructors Constructor Description AbstractInputDevice(String key, DeviceFactoryInterface deviceFactory)
-
Method Summary
Modifier and Type Method Description void
accept(T event)
protected void
disableListener()
protected void
enableListener()
boolean
generatesEvents()
void
removeListener()
void
setListener(DeviceEventConsumer<T> listener)
Methods inherited from class com.diozero.internal.spi.AbstractDevice
close, closeDevice, getDeviceFactory, getKey, isOpen
-
Constructor Details
-
AbstractInputDevice
-
-
Method Details
-
accept
-
generatesEvents
public boolean generatesEvents() -
setListener
-
removeListener
public final void removeListener() -
enableListener
protected void enableListener() -
disableListener
protected void disableListener()
-