public abstract class Message
extends java.lang.Object
Constructor and Description |
---|
Message(byte[] data)
Creates a new Message for data streamed to the phone / tablet.
|
Message(java.util.Calendar timestamp,
byte[] data)
Creates a new Message for data received from the logger.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
Retrieves the sensor data as is.
|
abstract <T> T |
getData(java.lang.Class<T> type)
Interprets the data as the given type.
|
java.util.Calendar |
getTimestamp()
Retrieves the timestamp of when the data was either logged or received from a stream.
|
java.lang.String |
getTimestampAsString()
Retrieves the data timestamp as a formatted string.
|
java.lang.String |
toString() |
public Message(byte[] data)
data
- Data from a sensor streampublic Message(java.util.Calendar timestamp, byte[] data)
timestamp
- Date and time of when the data was createddata
- Sensor data from the loggerpublic java.util.Calendar getTimestamp()
public java.lang.String getTimestampAsString()
getTimestamp()
public byte[] getData()
public abstract <T> T getData(java.lang.Class<T> type)
type
- Type to interpret the data aspublic java.lang.String toString()
toString
in class java.lang.Object