T
- specific SensorValue
subclass contained in this eventpublic class SensorEvent<T extends SensorValue> extends EventObject
SensorValue
from an InputId
.source
Constructor and Description |
---|
SensorEvent(InputId input,
byte[] oldValue,
byte[] newValue,
T value)
Constructs a SensorEvent.
|
SensorEvent(SensorEvent<SensorValue> sensorEvent,
Function<SensorValue,T> sensorWrapper)
A copy constructor for subclasses, to easily wrap the
SensorValue in a
more specific subclass. |
Modifier and Type | Method and Description |
---|---|
InputId |
getInput()
The input port that triggered this event.
|
byte[] |
getNewValue()
The new value from this input, as a two byte array.
|
byte[] |
getOldValue()
The last known value from this input, prior to the event, as a two byte array.
|
T |
getValue()
The new value from this input wrapped in the SensorValue class, or sensor specific subclass.
|
String |
toString() |
getSource
public SensorEvent(InputId input, byte[] oldValue, byte[] newValue, T value)
input
- The input port that triggered this event.oldValue
- The last known value from this input, as a two byte array.newValue
- The new value from this input, as a two byte array.value
- The new value wrapped in the SensorValue class.public SensorEvent(SensorEvent<SensorValue> sensorEvent, Function<SensorValue,T> sensorWrapper)
SensorValue
in a
more specific subclass.sensorEvent
- The SensorEvent to be copiedsensorWrapper
- The constructor method reference for a SensorValue subclasspublic InputId getInput()
public byte[] getOldValue()
public byte[] getNewValue()
public T getValue()
public String toString()
toString
in class EventObject
Copyright © 2016–2023. All rights reserved.