com.sony.csl.j2me.locationapitools.tracking
Class TXTTrackWriter

java.lang.Object
  extended by com.sony.csl.j2me.locationapitools.tracking.TrackWriter
      extended by com.sony.csl.j2me.locationapitools.tracking.TXTTrackWriter
All Implemented Interfaces:
LocationProxyListener

public class TXTTrackWriter
extends TrackWriter

A TrackWriter subclass that stores a location track as a plain text (.txt) file

Author:
mstevens (Sony CSL Paris / Vrije Universiteit Brussel)

Field Summary
 
Fields inherited from class com.sony.csl.j2me.locationapitools.tracking.TrackWriter
characterEncoding, coveredDistance, firstLocation, firstLocationReceivalTime, firstValidLocation, lastLocation, lastLocationReceivalTime, lastValidLocation, locationProxy, maxAltitude, maxLatitude, maxLongitude, minAltitude, minLatitude, minLongitude, numberOfLocations, numberOfValidLocations, trackFileFolderPath, trackFilePath, trackName, tracksInvalids, trackStartTime
 
Constructor Summary
TXTTrackWriter(LocationProxy locationProxy, java.lang.String trackFileFolderPath, java.lang.String trackName)
           
TXTTrackWriter(LocationProxy locationProxy, java.lang.String trackFileFolderPath, java.lang.String trackName, boolean tracksInvalids)
           
 
Method Summary
protected  java.lang.String getFileExtension()
          Gets the file extension (e.g.: "txt") that is used on the files the TrackWriter creates
protected  void initializeBeforeStart()
          Allows subclasses to add initializations that should take place before tracking starts.
protected  void writeFooter()
          Writes the footer of the file.
protected  void writeHeader()
          Writes the header of the file.
protected  void writeLocation(Location location)
          Writes a new location to the file.
protected  void writePaused(java.lang.String reason)
           
protected  void writeProviderStateChanged(LocationProvider provider, int newState)
           
protected  void writeResumed()
           
 
Methods inherited from class com.sony.csl.j2me.locationapitools.tracking.TrackWriter
firstLocationFound, getCharacterEncoding, getCoveredDistance, getFirstLocation, getFirstLocationReceivalTime, getFirstValidLocation, getLastLocation, getLastLocationReceivalTime, getLastValidLocation, getLocationProxy, getMaxAltitude, getMaxLatitude, getMaxLongitude, getMinAltitude, getMinLatitude, getMinLongitude, getNumberOfLocations, getNumberOfValidLocations, getTrackFilePath, getTrackName, isPaused, isTracking, isTracksInvalids, locationProviderStateChanged, locationUpdated, pauseTracking, pauseTracking, proxyConnected, proxyDisconnected, receivesInvalidLocations, reset, resumeTracking, setCharacterEncoding, startTracking, stopTracking, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TXTTrackWriter

public TXTTrackWriter(LocationProxy locationProxy,
                      java.lang.String trackFileFolderPath,
                      java.lang.String trackName)
               throws java.lang.Exception
Throws:
java.lang.Exception

TXTTrackWriter

public TXTTrackWriter(LocationProxy locationProxy,
                      java.lang.String trackFileFolderPath,
                      java.lang.String trackName,
                      boolean tracksInvalids)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getFileExtension

protected java.lang.String getFileExtension()
Description copied from class: TrackWriter
Gets the file extension (e.g.: "txt") that is used on the files the TrackWriter creates

Specified by:
getFileExtension in class TrackWriter
Returns:
a String containing the file extension (without the '.')
See Also:
TrackWriter.getFileExtension()

writeHeader

protected void writeHeader()
Description copied from class: TrackWriter
Writes the header of the file.

Specified by:
writeHeader in class TrackWriter
See Also:
TrackWriter.writeHeader()

writeLocation

protected void writeLocation(Location location)
Description copied from class: TrackWriter
Writes a new location to the file.

Specified by:
writeLocation in class TrackWriter
See Also:
TrackWriter.writeLocation(javax.microedition.location.Location)

writePaused

protected void writePaused(java.lang.String reason)
Specified by:
writePaused in class TrackWriter
See Also:
TrackWriter.writePaused(java.lang.String)

writeResumed

protected void writeResumed()
Specified by:
writeResumed in class TrackWriter
See Also:
TrackWriter.writeResumed()

writeProviderStateChanged

protected void writeProviderStateChanged(LocationProvider provider,
                                         int newState)
Specified by:
writeProviderStateChanged in class TrackWriter
See Also:
TrackWriter.writeProviderStateChanged(javax.microedition.location.LocationProvider, int)

writeFooter

protected void writeFooter()
Description copied from class: TrackWriter
Writes the footer of the file.

Specified by:
writeFooter in class TrackWriter
See Also:
TrackWriter.writeFooter()

initializeBeforeStart

protected void initializeBeforeStart()
Description copied from class: TrackWriter
Allows subclasses to add initializations that should take place before tracking starts.

Specified by:
initializeBeforeStart in class TrackWriter
See Also:
TrackWriter.initializeBeforeStart()