cl::utfsm::samplingSystemUI::SamplingDataCorrelator Class Reference

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

List of all members.

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

Detailed Description

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.

Author:
Arturo Hoffstadt Urrutia <ahoffsta@inf.utfsm.cl>

Constructor & Destructor Documentation

cl::utfsm::samplingSystemUI::SamplingDataCorrelator::SamplingDataCorrelator ( String  group,
long  frequency,
Date  startTimestamp 
) [inline]

Default constructor, takes the parameters, stores them, and creates the filename.

Parameters:
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.


Member Function Documentation

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.

Parameters:
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.

Returns:
True in case that there remains lines to be consumed, and false in case that no lines remain in every file.

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.

Parameters:
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]
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().


Member Data Documentation

Referenced by openReadWrite().

Referenced by dumpToFile().

ArrayList<ArrayList<Double> > cl::utfsm::samplingSystemUI::SamplingDataCorrelator::meanData [private]

Referenced by dumpToFile(), and openReadWrite().


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

Generated by  doxygen 1.6.2