com.anji.persistence
Interface Persistence

All Superinterfaces:
Configurable
All Known Implementing Classes:
FilePersistence, HibernatePersistence

public interface Persistence
extends Configurable

Abstract interface to persistence layer.

Author:
Philip Tucker

Field Summary
static java.lang.String PERSISTENCE_CLASS_KEY
          properties key; persistence class implementation
 
Method Summary
 void deleteChromosome(java.lang.String id)
          delete chromosome identified by by id
 void init(Properties newProps)
          See Parameter Details for specific property settings.
 Chromosome loadChromosome(java.lang.String id, Configuration config)
           
 Genotype loadGenotype(Configuration config)
          loads genotype as of latest generation in run
 void reset()
          remove all data from storage
 void startRun(java.lang.String runId)
          Begin run.
 void store(Activator a)
           
 void store(Chromosome c)
           
 void store(Run r)
           
 

Field Detail

PERSISTENCE_CLASS_KEY

public static final java.lang.String PERSISTENCE_CLASS_KEY
properties key; persistence class implementation

See Also:
Constant Field Values
Method Detail

init

public void init(Properties newProps)
See Parameter Details for specific property settings.

Specified by:
init in interface Configurable
Parameters:
newProps - configuration parameters

reset

public void reset()
remove all data from storage


store

public void store(Chromosome c)
           throws java.lang.Exception
Parameters:
c - chromosome to store
Throws:
java.lang.Exception

store

public void store(Activator a)
           throws java.lang.Exception
Parameters:
a - activator to store
Throws:
java.lang.Exception

store

public void store(Run r)
           throws java.lang.Exception
Parameters:
r - run to store
Throws:
java.lang.Exception

deleteChromosome

public void deleteChromosome(java.lang.String id)
                      throws java.lang.Exception
delete chromosome identified by by id

Parameters:
id - id of chromosome to delete
Throws:
java.lang.Exception

loadChromosome

public Chromosome loadChromosome(java.lang.String id,
                                 Configuration config)
Parameters:
id -
config -
Returns:
chromosome from persistence

loadGenotype

public Genotype loadGenotype(Configuration config)
loads genotype as of latest generation in run

Parameters:
config -
Returns:
genotype; null if there is no previous run

startRun

public void startRun(java.lang.String runId)
Begin run. All successive calls to this persistance object will be in the context of this run.

Parameters:
runId -