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
,InternalDeviceInterface
,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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(T event)
protected void
closeDevice()
protected void
disableListener()
protected void
enableListener()
boolean
generatesEvents()
protected boolean
isListenerEnabled()
void
removeListener()
void
setListener(DeviceEventConsumer<T> listener)
-
Methods inherited from class com.diozero.internal.spi.AbstractDevice
close, getDeviceFactory, getKey, isChild, isOpen, setChild
-
-
-
-
Constructor Detail
-
AbstractInputDevice
public AbstractInputDevice(String key, DeviceFactoryInterface deviceFactory)
-
-
Method Detail
-
accept
public void accept(T event)
-
generatesEvents
public boolean generatesEvents()
-
setListener
public final void setListener(DeviceEventConsumer<T> listener)
-
removeListener
public final void removeListener()
-
enableListener
protected void enableListener()
-
disableListener
protected void disableListener()
-
isListenerEnabled
protected boolean isListenerEnabled()
-
closeDevice
protected void closeDevice()
- Specified by:
closeDevice
in classAbstractDevice
-
-