
Public Member Functions | |
| SamplingDataCorrelator (String group, long frequency, Date startTimestamp) | |
| void | addSamplingSet (String filename) |
| void | dumpToFile () |
| void | dumpToFile (double prec) |
| boolean | consume () |
| String | getFilename () |
Private Member Functions | |
| void | openReadWrite () |
| BufferedReader | openReadOnly (String filename) |
| double | mean (int index) |
| void | addValueToMean (int index, double value) |
Private Attributes | |
| String | filename = "" |
| String | group = "" |
| long | frequency |
| Date | startTimestamp = null |
| FileWriter | file |
| BufferedWriter | writer |
| String | header |
| ArrayList< ArrayList< DataItem > > | data |
| ArrayList< BufferedReader > | readers |
| ArrayList< String > | headers |
| IsoDateFormat | formater |
| int | meanQty |
| ArrayList< ArrayList< Double > > | meanData |
This class correlates various sampling sets through time, and outputs them in a nicely csv file.
This class takes various Sampling Data file outputs, which are passed through the addSamplingSet method. Once finished adding Sampling Set, just call the dumpToFile method, and the data will be correlated. Please notice that the usage of memory is minimal and has to be kept whis way.
| cl::utfsm::samplingSystemUI::SamplingDataCorrelator::SamplingDataCorrelator | ( | String | group, | |
| long | frequency, | |||
| Date | startTimestamp | |||
| ) | [inline] |
Default constructor, takes the parameters, stores them, and creates the filename.
| group | The name of the Sampling Group to which the data belongs to. | |
| frequency | The Frequency at which the data was sampled. | |
| startTimestamp | At which time that sampling process started. |
References data, filename, formater, header, headers, meanData, meanQty, and readers.
| void cl::utfsm::samplingSystemUI::SamplingDataCorrelator::addSamplingSet | ( | String | filename | ) | [inline] |
Registers a Sampling Set, and read the first line, obtaining the component and the property which sampled.
| filaname | Name of the file in which the data for this Sampling Set was dumped. |
References data, header, headers, meanData, openReadOnly(), and readers.
Referenced by cl::utfsm::samplingSystemUI::BeanGrouper::stopSample().
| void cl::utfsm::samplingSystemUI::SamplingDataCorrelator::addValueToMean | ( | int | index, | |
| double | value | |||
| ) | [inline, private] |
References meanData, and meanQty.
Referenced by dumpToFile().
| boolean cl::utfsm::samplingSystemUI::SamplingDataCorrelator::consume | ( | ) | [inline] |
Method that consumes one line on every cvs file, storing them on memory.
References data, formater, and readers.
Referenced by dumpToFile().
| void cl::utfsm::samplingSystemUI::SamplingDataCorrelator::dumpToFile | ( | double | prec | ) | [inline] |
Starts the correlation process. This method should only be called if you know what you are doing.
Setting the prec lower or higher will get you leaks of data.
| prec | How much of the Frequency will each entry take as a valid interval of time to look forward and backward for data. |
References addValueToMean(), consume(), data, formater, frequency, cl::utfsm::samplingSystemUI::core::DataItem::getTime(), cl::utfsm::samplingSystemUI::core::DataItem::getValue(), header, mean(), meanQty, openReadWrite(), and writer.
| void cl::utfsm::samplingSystemUI::SamplingDataCorrelator::dumpToFile | ( | ) | [inline] |
Start the Correlation and Dumping to File process.
References readers.
Referenced by cl::utfsm::samplingSystemUI::BeanGrouper::stopSample().
| String cl::utfsm::samplingSystemUI::SamplingDataCorrelator::getFilename | ( | ) | [inline] |
References filename.
Referenced by cl::utfsm::samplingSystemUI::BeanGrouper::startSample().
| double cl::utfsm::samplingSystemUI::SamplingDataCorrelator::mean | ( | int | index | ) | [inline, private] |
References meanData.
Referenced by dumpToFile().
| BufferedReader cl::utfsm::samplingSystemUI::SamplingDataCorrelator::openReadOnly | ( | String | filename | ) | [inline, private] |
Referenced by addSamplingSet().
| void cl::utfsm::samplingSystemUI::SamplingDataCorrelator::openReadWrite | ( | ) | [inline, private] |
Open the file with the filename specified in the object.
References file, filename, and writer.
Referenced by dumpToFile().
ArrayList<ArrayList<DataItem> > cl::utfsm::samplingSystemUI::SamplingDataCorrelator::data [private] |
Referenced by addSamplingSet(), consume(), dumpToFile(), and SamplingDataCorrelator().
FileWriter cl::utfsm::samplingSystemUI::SamplingDataCorrelator::file [private] |
Referenced by openReadWrite().
String cl::utfsm::samplingSystemUI::SamplingDataCorrelator::filename = "" [private] |
Referenced by getFilename(), openReadWrite(), and SamplingDataCorrelator().
Referenced by consume(), dumpToFile(), and SamplingDataCorrelator().
Referenced by dumpToFile().
String cl::utfsm::samplingSystemUI::SamplingDataCorrelator::group = "" [private] |
String cl::utfsm::samplingSystemUI::SamplingDataCorrelator::header [private] |
Referenced by addSamplingSet(), dumpToFile(), and SamplingDataCorrelator().
ArrayList<String> cl::utfsm::samplingSystemUI::SamplingDataCorrelator::headers [private] |
Referenced by addSamplingSet(), and SamplingDataCorrelator().
ArrayList<ArrayList<Double> > cl::utfsm::samplingSystemUI::SamplingDataCorrelator::meanData [private] |
Referenced by addSamplingSet(), addValueToMean(), mean(), and SamplingDataCorrelator().
Referenced by addValueToMean(), dumpToFile(), and SamplingDataCorrelator().
ArrayList<BufferedReader> cl::utfsm::samplingSystemUI::SamplingDataCorrelator::readers [private] |
Referenced by addSamplingSet(), consume(), dumpToFile(), and SamplingDataCorrelator().
Date cl::utfsm::samplingSystemUI::SamplingDataCorrelator::startTimestamp = null [private] |
BufferedWriter cl::utfsm::samplingSystemUI::SamplingDataCorrelator::writer [private] |
Referenced by dumpToFile(), and openReadWrite().
1.6.2