
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 |
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.
| 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.
| group |
References data.
| 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.
| 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.
| 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.
| frequency | Frequency at which the data is to be separated in the printout file. |
| String cl::utfsm::samplingSystemUI::FileHelper::getFileName | ( | ) | [inline] |
References filename.
| void cl::utfsm::samplingSystemUI::FileHelper::initialize | ( | int | freq | ) | [inline] |
| 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.
| 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.
| header | Header of the content of the file. Is a resume of the properties. |
ArrayList<ArrayList<DataItem> > cl::utfsm::samplingSystemUI::FileHelper::data [private] |
Referenced by addSamplingSet(), dumpToFile(), FileHelper(), and removeSamplingSets().
FileWriter cl::utfsm::samplingSystemUI::FileHelper::file [private] |
Referenced by openFile().
String cl::utfsm::samplingSystemUI::FileHelper::filename = "" [private] |
Referenced by getFileName(), initialize(), and openFile().
String cl::utfsm::samplingSystemUI::FileHelper::group = "" [private] |
Referenced by initialize(), and setFilePrefix().
String cl::utfsm::samplingSystemUI::FileHelper::header [private] |
Referenced by dumpToFile().
BufferedWriter cl::utfsm::samplingSystemUI::FileHelper::writer [private] |
Referenced by dumpToFile(), and openFile().
1.6.2