fr.ifremer.isisfish.datastore
Class SimulationInformation

java.lang.Object
  extended by fr.ifremer.isisfish.datastore.SimulationInformation

public class SimulationInformation
extends Object

Cette classe permet de conserver des informations sur le deroulement d'une simulation. La plupart des informations sont automatiquement renseignees, mais l'utilisateur peut lui aussi ajouter des informations avec la methode addInformation(String).

Version:
$Revision: 2658 $ Last update: $Date: 2009-10-13 17:00:50 +0200 (mar., 13 oct. 2009) $ by : $Author: chatellier $
Author:
poussin

Field Summary
protected  File file
           
protected  Properties info
           
 
Constructor Summary
SimulationInformation(File file)
          Constructor.
 
Method Summary
 void addExportTime(String exportName, long time)
           
 void addInformation(String info)
          Add additional simulation information.
 void addRuleInitTime(String ruleName, long time)
          Add rule init time.
 void addRulePostTime(String ruleName, long time)
          Add rule post operation time.
 void addRulePreTime(String ruleName, long time)
          Add rule pre operation time time.
protected  void addRuleTime(String keyName, String ruleName, long time)
          Add rule time.
 String getException()
           
 Map<String,Long> getExportTime()
          Deprecated. since 3.2.0.5, use getExportTimes() instead
 long getExportTime(String exportName)
           
protected  Map<String,Long> getExportTimes()
          Get all export time in map.
 String getInfomation()
          Deprecated. since 3.2.0.5, use getInformation() instead
protected  String getInformation()
          Get other information.
 String getOptimizationUsage()
           
 long getRuleInitTime(String ruleName)
          Get rule init operation time.
protected  Set<String> getRuleNames()
          Get rules names.
 long getRulePostTime(String ruleName)
          Get rule post operation time.
 long getRulePreTime(String ruleName)
          Get rule pre operation time.
protected  long getRuleTime(String prefixName, String ruleName)
          Get rule operation time.
 Date getSimulationEnd()
          Get the date of simulation start.
 Date getSimulationStart()
          Get the date of simulation start.
 String getStatistic()
           
 boolean hasError()
          Return true if an exception has been set.
 void setException(Throwable eee)
           
protected  void setInfo(String key, String value)
           
 void setOptimizationUsage(String v)
           
 void setSimulationEnd(Date date)
           
 void setSimulationStart(Date date)
           
 void setStatistic(String v)
           
protected  void store()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

info

protected Properties info

file

protected File file
Constructor Detail

SimulationInformation

public SimulationInformation(File file)
Constructor. If file already exists, load his content into current instance.

Parameters:
file - simulation information output file
Method Detail

toString

public String toString()
Overrides:
toString in class Object

store

protected void store()

setInfo

protected void setInfo(String key,
                       String value)

getSimulationStart

public Date getSimulationStart()
Get the date of simulation start.

Returns:
simulation start date

setSimulationStart

public void setSimulationStart(Date date)

getSimulationEnd

public Date getSimulationEnd()
Get the date of simulation start.

Returns:
simulation end date

setSimulationEnd

public void setSimulationEnd(Date date)

addExportTime

public void addExportTime(String exportName,
                          long time)

getExportTimes

protected Map<String,Long> getExportTimes()
Get all export time in map.

Returns:
a map with all export time

getExportTime

public Map<String,Long> getExportTime()
Deprecated. since 3.2.0.5, use getExportTimes() instead

Get all export time in map.

Returns:
a map with all export time

getExportTime

public long getExportTime(String exportName)

addRuleTime

protected void addRuleTime(String keyName,
                           String ruleName,
                           long time)
Add rule time. If a time already exists for ruleName, add time to previous time. (usefull because pre/post action are called multiples time)

Parameters:
keyName - (ie RULE_TIME_INIT, RULE_TIME_PRE, RULE_TIME_POST)
ruleName - rule name
time - time to add
Since:
3.2.0.5

addRuleInitTime

public void addRuleInitTime(String ruleName,
                            long time)
Add rule init time. If a time already exists for ruleName, add time to previous time.

Parameters:
ruleName - rule name
time - time to add
Since:
3.2.0.5

addRulePreTime

public void addRulePreTime(String ruleName,
                           long time)
Add rule pre operation time time. If a time already exists for ruleName, add time to previous time.

Parameters:
ruleName - rule name
time - time to add
Since:
3.2.0.5

addRulePostTime

public void addRulePostTime(String ruleName,
                            long time)
Add rule post operation time. If a time already exists for ruleName, add time to previous time.

Parameters:
ruleName - rule name
time - time to add
Since:
3.2.0.5

getRuleInitTime

public long getRuleInitTime(String ruleName)
Get rule init operation time.

Parameters:
ruleName - rule name
Returns:
time
Since:
3.2.0.5

getRulePreTime

public long getRulePreTime(String ruleName)
Get rule pre operation time.

Parameters:
ruleName - rule name
Returns:
time
Since:
3.2.0.5

getRulePostTime

public long getRulePostTime(String ruleName)
Get rule post operation time.

Parameters:
ruleName - rule name
Returns:
time
Since:
3.2.0.5

getRuleTime

protected long getRuleTime(String prefixName,
                           String ruleName)
Get rule operation time.

Parameters:
ruleName - rule name
Since:
3.2.0.5

getRuleNames

protected Set<String> getRuleNames()
Get rules names.

Returns:
a map with all export time

getStatistic

public String getStatistic()

setStatistic

public void setStatistic(String v)

getOptimizationUsage

public String getOptimizationUsage()

setOptimizationUsage

public void setOptimizationUsage(String v)

getException

public String getException()

setException

public void setException(Throwable eee)

hasError

public boolean hasError()
Return true if an exception has been set.

Returns:
true if there is an exception

getInfomation

public String getInfomation()
Deprecated. since 3.2.0.5, use getInformation() instead

Returns:
other information

getInformation

protected String getInformation()
Get other information.

Returns:
other information

addInformation

public void addInformation(String info)
Add additional simulation information.

Parameters:
info - new info


Copyright © 1999-2010 CodeLutin. All Rights Reserved.