de.dfg.oc.logfileanalyzer
Class DataMemory

java.lang.Object
  extended by de.dfg.oc.logfileanalyzer.DataMemory

public class DataMemory
extends Object

The DataMemory stores the DataElements of all iterations of an experiment. It relies on the DataImporterInterface to read complete log-files and provides a method to search for DataElements by their iteration number.

Author:
Clemens Gersbacher, Holger Prothmann

Field Summary
private  Vector<DataElement> data
          Contains all DataElements of an experiment.
private  File logFile
          The log-file that will be read.
 
Constructor Summary
DataMemory(File _logFile)
          Creates a new DataMemory that stores all iterations of an experiment.
 
Method Summary
 DataElement getFirstElement()
          Returns the DataElement of the first iteration.
 DataElement getLastElement()
          Returns the DataElement of the last iteration.
 void readData()
          Reads a complete log-file and stores the contained classifier sets iterationwise.
private  void saveElement(DataElement _element)
          Stores a DataElement in the memory and updates the object's next- and previous-references.
 DataElement searchElement(double _iteration)
          Searches for a DataElement by its iteration number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private Vector<DataElement> data
Contains all DataElements of an experiment.


logFile

private File logFile
The log-file that will be read.

Constructor Detail

DataMemory

public DataMemory(File _logFile)
Creates a new DataMemory that stores all iterations of an experiment.

Parameters:
_logFile - The log-file that will be read.
Method Detail

readData

public void readData()
Reads a complete log-file and stores the contained classifier sets iterationwise.


saveElement

private void saveElement(DataElement _element)
Stores a DataElement in the memory and updates the object's next- and previous-references.

Parameters:
_element - DataElement that will be stored

getLastElement

public DataElement getLastElement()
Returns the DataElement of the last iteration. Returns null if no DataElements are stored in this memory.

Returns:
the DataElement of the last iteration

getFirstElement

public DataElement getFirstElement()
Returns the DataElement of the first iteration. Returns null if no DataElements are stored in this memory.

Returns:
the DataElement of the first iteration

searchElement

public DataElement searchElement(double _iteration)
Searches for a DataElement by its iteration number. If the iteration number is not present in this memory, the method returns the DataElement whose iteration number is closest to the given iteration. If no elements are stored in this memory, the method returns null.

Parameters:
_iteration - an iteration number
Returns:
DataElement whose iteration number is closest to _iteration