T
- Event class that extends DeviceEvent. See
DigitalInputEvent
and
AnalogInputEvent
.public abstract class GpioInputDevice<T extends DeviceEvent> extends GpioDevice implements InputEventListener<T>
Modifier and Type | Field and Description |
---|---|
protected Collection<InputEventListener<T>> |
listeners |
pinNumber
Constructor and Description |
---|
GpioInputDevice(int pinNumber) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(InputEventListener<T> listener)
Add a new listener.
|
protected abstract void |
disableListener() |
protected abstract void |
enableListener() |
void |
removeAllListeners()
Remove all listeners.
|
void |
removeListener(InputEventListener<T> listener)
Remove a specific listener.
|
void |
valueChanged(T event) |
getPinNumber
protected Collection<InputEventListener<T extends DeviceEvent>> listeners
public GpioInputDevice(int pinNumber)
pinNumber
- Pin number to which the device is connected.public void addListener(InputEventListener<T> listener)
listener
- Callback instance.public void removeListener(InputEventListener<T> listener)
listener
- Callback instance to remove.public void removeAllListeners()
public void valueChanged(T event)
valueChanged
in interface InputEventListener<T extends DeviceEvent>
protected abstract void enableListener()
protected abstract void disableListener()
Copyright © 2016 mattjlewis. All rights reserved.