de.unikassel.android.sdcframework.data
Class Sample

Package class diagram package Sample
java.lang.Object
  extended by de.unikassel.android.sdcframework.data.independent.BasicSample
      extended by de.unikassel.android.sdcframework.data.Sample
All Implemented Interfaces:
Parcelable, SerializableData, BroadcastableEvent, ObservableEvent

public final class Sample
extends BasicSample
implements ObservableEvent, BroadcastableEvent, Parcelable

Implementation of the sensor device sample used inside of the framework.

A sensor device sample is observable, parcelable and broadcastable. It does extend the pure Java sample representation.

See Also:
SampleData, GSMSampleData, GPSSampleData, AccelerometerSampleData, BluetoothSampleData, WifiSampleData

Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.Creator<T>
 
Field Summary
static Parcelable.Creator<Sample> CREATOR
          The Parcelable creator.
static String PARCELABLE_EXTRA_NAME
          The parcelable extra name for intent transport.
 
Fields inherited from class de.unikassel.android.sdcframework.data.independent.BasicSample
ACTION, deviceIdentifier, timeStamp
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
Sample()
          Constructor
Sample(Parcel source)
          Constructor
Sample(Sample sample)
          Copy-Constructor
Sample(SensorDeviceIdentifier id)
          Constructor
Sample(SensorDeviceIdentifier id, long timeStamp, int priority, boolean timeSynced)
          Constructor
Sample(String sId, long timeStamp, int priority, boolean timeSynced)
          Constructor
 
Method Summary
 int describeContents()
           
 Intent getIntent()
          Getter for an intent representation
 String getRelatedData()
          Getter for related data
private  void readFromParcel(Parcel source)
          Method to read all values from a parcel
 void updateRelatedData(String fileName)
          Update method for related data ( used to update relative file location for transmitted samples )
 void writeToParcel(Parcel dest, int flags)
           
 
Methods inherited from class de.unikassel.android.sdcframework.data.independent.BasicSample
equals, equals, getData, getDeviceIdentifier, getLocation, getPriority, getTimeStamp, isTimeSynced, setData, setDataFromXML, setDeviceIdentifier, setLocation, setLocationFromXML, setPriority, setTimeStamp, setTimeSynced, toString, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARCELABLE_EXTRA_NAME

public static final String PARCELABLE_EXTRA_NAME
The parcelable extra name for intent transport.


CREATOR

public static final Parcelable.Creator<Sample> CREATOR
The Parcelable creator.

Constructor Detail

Sample

public Sample()
Constructor


Sample

public Sample(SensorDeviceIdentifier id)
Constructor

Parameters:
id - the sensor device identifier

Sample

public Sample(String sId,
              long timeStamp,
              int priority,
              boolean timeSynced)
Constructor

Parameters:
sId - the sensor device identifier string representation
timeStamp - the sample time stamp
priority - the sample transmission priority
timeSynced - flag is time stamp is valid ( time provider was in sync with NTP time)

Sample

public Sample(SensorDeviceIdentifier id,
              long timeStamp,
              int priority,
              boolean timeSynced)
Constructor

Parameters:
id - the sensor device identifier
timeStamp - the sample time stamp
priority - the sample transmission priority
timeSynced - flag is time stamp is valid ( time provider was in sync with NTP time)

Sample

public Sample(Sample sample)
Copy-Constructor

Parameters:
sample - the sample to copy construct from

Sample

public Sample(Parcel source)
Constructor

Parameters:
source - the parcel source
Method Detail

readFromParcel

private void readFromParcel(Parcel source)
Method to read all values from a parcel

Parameters:
source - the parcel source

writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)
Specified by:
writeToParcel in interface Parcelable

getIntent

public final Intent getIntent()
Description copied from interface: BroadcastableEvent
Getter for an intent representation

Specified by:
getIntent in interface BroadcastableEvent
Returns:
the Intent representation of this LogEvent

getRelatedData

public String getRelatedData()
Getter for related data

Returns:
the path to a related data file if existing, null otherwise

updateRelatedData

public void updateRelatedData(String fileName)
Update method for related data ( used to update relative file location for transmitted samples )

Parameters:
fileName - the new filename

describeContents

public int describeContents()
Specified by:
describeContents in interface Parcelable