|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.core.Measurement
org.placelab.core.BeaconMeasurement
BeaconMeasurements contain all the BeaconReadings seen during a single scan of the environment for Beacons.
| Field Summary | |
protected java.lang.String |
interfaceName
|
static BeaconReading[] |
noBtReadings
|
static BeaconReading[] |
noGSMReadings
|
static BeaconReading[] |
noWifiReadings
|
protected int |
numReadings
|
protected BeaconReading[] |
readings
|
| Constructor Summary | |
BeaconMeasurement(long timestamp)
|
|
BeaconMeasurement(long timestamp,
BeaconReading[] readings)
|
|
BeaconMeasurement(long timestamp,
boolean mergeDuplicateReadings)
|
|
BeaconMeasurement(java.lang.String type,
long time,
java.io.DataInputStream dis)
|
|
| Method Summary | |
boolean |
addReading(BeaconReading r)
Add a BeaconReading to this BeaconMeasurement |
void |
addReadings(BeaconReading[] readings)
Batch load the given readings |
BeaconReading |
getReading(int index)
|
BeaconReading |
getReadingById(java.lang.String id)
|
BeaconReading[] |
getReadings()
Gets all the readings for this BeaconReading. |
protected java.lang.String |
ifStr()
|
java.util.Enumeration |
iterator()
|
int |
numberOfReadings()
|
void |
setInterfaceName(java.lang.String _interfaceName)
|
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 org.placelab.core.Measurement |
fromCompressedBytes, getTimestamp, setTimestamp |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected BeaconReading[] readings
protected int numReadings
protected java.lang.String interfaceName
public static final BeaconReading[] noWifiReadings
public static final BeaconReading[] noGSMReadings
public static final BeaconReading[] noBtReadings
| Constructor Detail |
public BeaconMeasurement(long timestamp)
public BeaconMeasurement(long timestamp,
boolean mergeDuplicateReadings)
timestamp - the time at which the scan for BeaconReadings beganmergeDuplicateReadings - merge BeaconReadings that have the same unique id
public BeaconMeasurement(long timestamp,
BeaconReading[] readings)
timestamp - the time at which the scan for BeaconReadings beganreadings - the set of BeaconReadings to start with
public BeaconMeasurement(java.lang.String type,
long time,
java.io.DataInputStream dis)
throws java.io.IOException
| Method Detail |
public void setInterfaceName(java.lang.String _interfaceName)
protected java.lang.String ifStr()
public boolean addReading(BeaconReading r)
r - the BeaconReading to add
r
already existed in this BeaconMeasurementpublic void addReadings(BeaconReading[] readings)
public BeaconReading[] getReadings()
public int numberOfReadings()
public BeaconReading getReading(int index)
public BeaconReading getReadingById(java.lang.String id)
public java.lang.String toLogString()
MeasurementTYPE=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.
toLogString in class Measurementpublic java.lang.String toShortString()
Measurement
toShortString in class Measurementpublic byte[] toCompressedBytes()
Measurement
toCompressedBytes in class Measurementpublic java.util.Enumeration iterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||