elge.storage
Interface DataStorage

All Known Implementing Classes:
DataRecorder

public interface DataStorage

DataStorage should be a flexible storage for data. DataStorage is initialized without monitors or with some if needed. The monitors could be added or removed from the DataStorage. Or whole vector of monitors can be replaced! The DataStorage should adapt to the changes, and not to reset already created values. DataStorage is also responsible for getting values from the monitors for whole simulation range or any other range.. example: DataStorage.get("tick", "1..20") - returs 1..20 :)) DataStorage.getAll("coherence"); //and so on... The main atribute for storing data is the data tick. Data tick is diferent from the life tick. Life tick can be repeated (can?) bud data tick will be different. The graphs, whould like to get for X axis the LifeTick and for Y axis any other value...

Author:
Pavol Žibrita

Method Summary
 void close()
          Makes flush and save the data.
 com.jrefinery.data.CategoryDataset getLastTickCategoryDataset(List property)
          An category dataset.
 com.jrefinery.data.PieDataset getLastTickPieDataset(List property)
          Pie dataset for the pie graph.
 List getPropertyNames()
          Get actual list of properties that are monitored and stored to the disk.
 DataStorage getRun(int index)
          Returns a DataStorage for older simulation data.
 List getRunNames()
          Every storage is responsible for the runs, that user makes.
 Object getValue(int tick, String property)
          retruns a value for tick and property.
 com.jrefinery.data.XYDataset getXYTickValueDataset(List property)
          Like above
 com.jrefinery.data.XYDataset getXYTickValueDataset(List property, int window)
          like above
 com.jrefinery.data.XYDataset getXYTickValueDataset(String[] property)
          Retrusn a dataset for graph with multiple properties
 com.jrefinery.data.XYDataset getXYTickValueDataset(String property, int window)
          Retrusn a dataset for graph
 Integer lastTick()
          The lastTick that was recorder by this storage
 void record(Vector monitors)
          This method should get avaible data from the monitors and store them.
 

Method Detail

record

public void record(Vector monitors)
            throws IOException
This method should get avaible data from the monitors and store them.

Parameters:
monitors - The vector of monitors.
Throws:
IOException - if some io problem occures.

close

public void close()
Makes flush and save the data. This should be called when the recording is over. If record is called after close, exception should be thrown.


getRunNames

public List getRunNames()
Every storage is responsible for the runs, that user makes. So one simulation coresponds to one data storage and one run. This method returns the run names user can display. To get the specific simulation data, use the getRun method.

Returns:
List of available data of older simulations
See Also:
getRun(int)

getRun

public DataStorage getRun(int index)
Returns a DataStorage for older simulation data.

Parameters:
index - index of older simulation
Returns:
DataStorage for older simulation.

getPropertyNames

public List getPropertyNames()
Get actual list of properties that are monitored and stored to the disk.

Returns:
List of monitored properties

getXYTickValueDataset

public com.jrefinery.data.XYDataset getXYTickValueDataset(String property,
                                                          int window)
Retrusn a dataset for graph

Parameters:
property - property name
window - the tick step size
Returns:
the dataset

getXYTickValueDataset

public com.jrefinery.data.XYDataset getXYTickValueDataset(String[] property)
Retrusn a dataset for graph with multiple properties

Parameters:
property - the list of properties
Returns:
the dataset

getXYTickValueDataset

public com.jrefinery.data.XYDataset getXYTickValueDataset(List property)
Like above

Parameters:
property - the properties
Returns:
dataset for graph

getXYTickValueDataset

public com.jrefinery.data.XYDataset getXYTickValueDataset(List property,
                                                          int window)
like above

Parameters:
property - propeties
window - the tick step size
Returns:
the dataset for graph

getLastTickCategoryDataset

public com.jrefinery.data.CategoryDataset getLastTickCategoryDataset(List property)
An category dataset. Unlike XYDataset, this category dataset shows only last values of the tick.

Parameters:
property - propeties
Returns:
dataset for graph

getLastTickPieDataset

public com.jrefinery.data.PieDataset getLastTickPieDataset(List property)
Pie dataset for the pie graph. Also a sipmle category dataset.

Parameters:
property - the property list
Returns:
a pie dataset for graph

lastTick

public Integer lastTick()
The lastTick that was recorder by this storage

Returns:
the last tick value.

getValue

public Object getValue(int tick,
                       String property)
retruns a value for tick and property.

Parameters:
tick - the tick
property - property name
Returns:
the stored value.