de.Android_Seminar.xmlCreator
Class XmlCreator

java.lang.Object
  extended by de.Android_Seminar.xmlCreator.XmlCreator
All Implemented Interfaces:
java.lang.Runnable

public class XmlCreator
extends java.lang.Object
implements java.lang.Runnable


Constructor Summary
XmlCreator(SensorController sensorController)
          constructor
 
Method Summary
 boolean deleteXmlFile(java.lang.String file)
          deletes an xml file
 long getActivityEndTime(java.lang.String file)
           
 java.lang.String getActivityName(java.lang.String file)
           
 long getActivityStartTime(java.lang.String file)
           
 java.util.LinkedList<java.lang.String> getXmlActivities()
          This method returns a list with all the available activities (xml files that already have been tagged) This names only consists of the file name without a path
 java.util.LinkedList<java.lang.String> getXmlRawData()
          This method returns a list with all the xml files that have not been tagged, yet.
 boolean isRecording()
          Determines if a recording is running
 void run()
          run method of this thread
 void startRecording()
           
 void startRecording(java.lang.String tag)
           
 void stopRecording()
          stops a current recording
 void tagActivity(java.lang.String tag, java.lang.String file, long startTime, long endTime)
          tags a activity (xml file) with a given tag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlCreator

public XmlCreator(SensorController sensorController)
constructor

Parameters:
sensorController - the SensorController where all the data will be obtained from
Method Detail

run

public void run()
run method of this thread

Specified by:
run in interface java.lang.Runnable

startRecording

public void startRecording()
Parameters:
file -

startRecording

public void startRecording(java.lang.String tag)
Parameters:
file -
tag -

stopRecording

public void stopRecording()
stops a current recording


tagActivity

public void tagActivity(java.lang.String tag,
                        java.lang.String file,
                        long startTime,
                        long endTime)
tags a activity (xml file) with a given tag

Parameters:
tag - the tag, the activity should be tagged with
file - the path and file name of the activity that should be tagged (path and file name of the xml file)
startTime -
endTime -

getXmlActivities

public java.util.LinkedList<java.lang.String> getXmlActivities()
This method returns a list with all the available activities (xml files that already have been tagged) This names only consists of the file name without a path

Returns:
the file name of the corresponding xml file

getXmlRawData

public java.util.LinkedList<java.lang.String> getXmlRawData()
This method returns a list with all the xml files that have not been tagged, yet. This names only consists of the file name without a path.

Returns:
the file name of the corresponding xml file

getActivityName

public java.lang.String getActivityName(java.lang.String file)
Parameters:
file - the file name of the xml file that contains the activity This file name must consist only of the file's name, not of it's path
Returns:
the name of the activity, or null if the data have not been tagged, yet

getActivityStartTime

public long getActivityStartTime(java.lang.String file)
Parameters:
file - the file name of the xml file that contains the activity This file name must consist only of the file's name, not of it's path
Returns:
the start time of an tagged or untagged activity -1 if no time was set.

getActivityEndTime

public long getActivityEndTime(java.lang.String file)
Parameters:
file - the file name of the xml file that contains the activity This file name must consist only of the file's name, not of it's path
Returns:
the end time of an tagged or untagged activity -1 if no time was set.

isRecording

public boolean isRecording()
Determines if a recording is running


deleteXmlFile

public boolean deleteXmlFile(java.lang.String file)
deletes an xml file

Parameters:
file - the file that should be deleted This file name must consist only of the file's name, not of it's path