|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.core.Measurement
Measurements are produced by Spotters and represent the result of a single scan of the environment.
| Constructor Summary | |
Measurement(long timestampInMillis)
Creates a Measurement with the given timestamp |
|
| Method Summary | |
static Measurement |
fromCompressedBytes(byte[] array)
Reconstruct the Measurement from its compressed form |
long |
getTimestamp()
Gets the time at which the Measurement was taken. |
void |
setTimestamp(long timestamp)
|
byte[] |
toCompressedBytes()
For storage on impoverished devices |
java.lang.String |
toLogString()
Converts the Measurement to a form which is convenient for writing to a log file. |
java.lang.String |
toShortString()
A short string based representation for debugging purposes |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Measurement(long timestampInMillis)
timestampInMillis - the time at which the
Measurement was taken| Method Detail |
public void setTimestamp(long timestamp)
public long getTimestamp()
getTimestamp in interface Observablepublic java.lang.String toLogString()
TYPE=type|TIME=timestamp|OTHERFIELD=value ...All necessary fields should be stored in that pipe separated format, and all values should be percentEscaped with
StringUtil.percentEscape(String)
Such a format is easily converted into a HashMap form, and a Measurement should (but is not required to) provide a constructor to build itself from a HashMap created from its log string form.
public java.lang.String toShortString()
public byte[] toCompressedBytes()
public static Measurement fromCompressedBytes(byte[] array)
toCompressedBytes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||