cl::utfsm::samplingSystemUI::FileHelper Class Reference

Collaboration diagram for cl::utfsm::samplingSystemUI::FileHelper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FileHelper ()
 FileHelper (String group)
void addSamplingSet (ArrayList< DataItem > samp)
void removeSamplingSets ()
void setHeaderFile (String header)
void setFilePrefix (String prefix)
String getFileName ()
void initialize (int freq)
void dumpToFile (long frequency)
void dumpToFile (long frequency, double prec)

Private Member Functions

void openFile ()

Private Attributes

String filename = ""
String group = ""
FileWriter file
BufferedWriter writer
String header
ArrayList< ArrayList< DataItem > > data

Detailed Description

Takes the data from the sampling groups and dumps it in correlated timestamps.

This class allows takes the ArrayLists that contains the data from a Sampling Group,
and when indicated so by the dumpToFile method, start the writing to a preestablished file.

Author:
javarias, abaltra
Arturo Hoffstadt Urrutia <ahoffsta[AT]inf.utfsm.cl>

Constructor & Destructor Documentation

cl::utfsm::samplingSystemUI::FileHelper::FileHelper (  )  [inline]

Default constructor. Initialize the data array with empty values.

References data.

cl::utfsm::samplingSystemUI::FileHelper::FileHelper ( String  group  )  [inline]

Overloaded constructor that sets the prefix/group of the Sampling Group.

Parameters:
group 

References data.


Member Function Documentation

void cl::utfsm::samplingSystemUI::FileHelper::addSamplingSet ( ArrayList< DataItem samp  )  [inline]

Adds a Sampling Set to the array containing some (or all) the data to be printed to file.

Parameters:
samp Sampling Set (data from one property), to be added to the set of data to be printed to the file.

References data.

void cl::utfsm::samplingSystemUI::FileHelper::dumpToFile ( long  frequency,
double  prec 
) [inline]

Start the dumping process. This method should only be called if you know what you are doing.
Setting the prec lower will get leaks of data, and setting it higher, will get you duplicated data.

Parameters:
frequency Frequency at which the data is to be separated in the printout file.
prec How much of the Frequency will each entry take as a valid interval of time to look forward and backward for data.

References data, cl::utfsm::samplingSystemUI::core::DataItem::getTime(), cl::utfsm::samplingSystemUI::core::DataItem::getValue(), header, openFile(), and writer.

void cl::utfsm::samplingSystemUI::FileHelper::dumpToFile ( long  frequency  )  [inline]

Start the dumping process.

Parameters:
frequency Frequency at which the data is to be separated in the printout file.
String cl::utfsm::samplingSystemUI::FileHelper::getFileName (  )  [inline]
Returns:
Name of the file which the data will be dumped.

References filename.

void cl::utfsm::samplingSystemUI::FileHelper::initialize ( int  freq  )  [inline]

References filename, and group.

void cl::utfsm::samplingSystemUI::FileHelper::openFile (  )  [inline, private]

Open the file with the filename specificated in the object.

References file, filename, and writer.

Referenced by dumpToFile().

void cl::utfsm::samplingSystemUI::FileHelper::removeSamplingSets (  )  [inline]

Re initialize the data, erasing everything.

References data.

void cl::utfsm::samplingSystemUI::FileHelper::setFilePrefix ( String  prefix  )  [inline]

Sets the prefix for the filename. Usually the sampling group name.

Parameters:
prefix 

References group.

void cl::utfsm::samplingSystemUI::FileHelper::setHeaderFile ( String  header  )  [inline]

Sets the header that will be printed at the beginning of the file.

Parameters:
header Header of the content of the file. Is a resume of the properties.

Member Data Documentation

ArrayList<ArrayList<DataItem> > cl::utfsm::samplingSystemUI::FileHelper::data [private]

Referenced by openFile().

Referenced by getFileName(), initialize(), and openFile().

Referenced by initialize(), and setFilePrefix().

Referenced by dumpToFile().

Referenced by dumpToFile(), and openFile().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2