|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.data.independent.BasicSample
public class BasicSample
This is the framework independent serializable sample representation, which can
be used in pure Java projects for deserialization.
A sensor device sample has
device identifier
for the source sensor
device,time stamp
and
Sample
Field Summary | |
---|---|
static String |
ACTION
Our custom sample intent action |
private SampleData |
data
The device specific sensor data |
protected String |
deviceIdentifier
the sample device identifier |
private GeoLocation |
location
The associated location |
private int |
priority
the sample priority for transmission |
protected long |
timeStamp
the sample time stamp |
private Boolean |
timeSynced
flag if the sample time stamp is taken while time provider was in sync with NTP time. |
Constructor Summary | |
---|---|
BasicSample()
Constructor |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
static boolean |
equals(Object o1,
Object o2)
Test method for equivalence of two objects, allowing both being null as well |
SampleData |
getData()
Getter for the sample data |
String |
getDeviceIdentifier()
Getter for the device identifier ( string representation of the sensors identifier ) |
GeoLocation |
getLocation()
Getter for the location |
int |
getPriority()
Getter for the priority ( ordinal value of a priority level ) |
long |
getTimeStamp()
Getter for the time stamp ( the number of milliseconds since January 1, 1970, 00:00:00 GMT ) |
Boolean |
isTimeSynced()
Getter for the timeSynced |
void |
setData(SampleData data)
Setter for the sample data |
boolean |
setDataFromXML(String dataType,
String xml)
Method to create data from XML |
void |
setDeviceIdentifier(String deviceIdentifier)
Setter for the device identifier ( string representation of the sensors identifier ) |
void |
setLocation(GeoLocation location)
Setter for the location |
boolean |
setLocationFromXML(String xml)
Method to create location from XML representation |
void |
setPriority(int priority)
Setter for the priority ( ordinal value of a priority level ) |
void |
setTimeStamp(long timeStamp)
Setter for the time stamp ( the number of milliseconds since January 1, 1970, 00:00:00 GMT ) |
void |
setTimeSynced(Boolean timeSynced)
Setter for the timeSynced |
String |
toString()
|
String |
toXML()
Serialization from the type to it's XML representation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ACTION
protected String deviceIdentifier
protected long timeStamp
private int priority
private Boolean timeSynced
private SampleData data
private GeoLocation location
Constructor Detail |
---|
public BasicSample()
Method Detail |
---|
public final boolean setLocationFromXML(String xml)
xml
- the XML representation of the location
public final boolean setDataFromXML(String dataType, String xml)
dataType
- the data type class namexml
- the XML representation of the data
public static final boolean equals(Object o1, Object o2)
o1
- first objecto2
- second object
public final boolean equals(Object o)
equals
in class Object
public final void setTimeStamp(long timeStamp)
timeStamp
- the time stamp to setpublic final long getTimeStamp()
public Boolean isTimeSynced()
public void setTimeSynced(Boolean timeSynced)
timeSynced
- the timeSynced to setpublic final void setPriority(int priority)
priority level
)
priority
- the priority to setpublic final int getPriority()
priority level
)
public final SampleData getData()
public final void setData(SampleData data)
data
- the sample data to setpublic final void setDeviceIdentifier(String deviceIdentifier)
identifier
)
deviceIdentifier
- the device identifier to setpublic final String getDeviceIdentifier()
identifier
)
public void setLocation(GeoLocation location)
location
- the location to setpublic GeoLocation getLocation()
public final String toString()
toString
in class Object
public final String toXML() throws Exception
SerializableData
toXML
in interface SerializableData
Exception
- if the schema for the object is not valid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |