|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.anji.persistence.FilePersistence
public class FilePersistence
Simple file-based implementation of persistence layer. All files are stored in a file named
baseDir/type/type+key. All
objects stores must implement XmlPersistable.type is derived
from XmlPersistable.getXmlRootTag(), and key is derived from
XmlPersistable.getId().
| Field Summary | |
|---|---|
static java.lang.String |
BASE_DIR_KEY
properties key, base directory for persistence storage |
| Fields inherited from interface com.anji.persistence.Persistence |
|---|
PERSISTENCE_CLASS_KEY |
| Constructor Summary | |
|---|---|
FilePersistence()
|
|
| Method Summary | |
|---|---|
static Chromosome |
chromosomeFromXml(Configuration config,
org.w3c.dom.Node chromNode)
|
static Chromosome |
chromosomeFromXml(Configuration config,
java.lang.String xml)
|
void |
deleteChromosome(java.lang.String id)
delete chromosome identified by by id |
protected java.lang.String |
fullPath(java.lang.String type,
java.lang.String key)
Construct full path of file based on type and key. |
void |
init(Properties props)
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 aRunId)
Begin run. |
void |
store(Activator a)
|
void |
store(Chromosome c)
|
void |
store(Run r)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BASE_DIR_KEY
| Constructor Detail |
|---|
public FilePersistence()
| Method Detail |
|---|
public void init(Properties props)
init in interface Persistenceinit in interface Configurableprops - configuration parameters
protected java.lang.String fullPath(java.lang.String type,
java.lang.String key)
type and key.
type - key -
public void reset()
Persistence
reset in interface PersistencePersistence.reset()
public void store(Chromosome c)
throws java.lang.Exception
store in interface Persistencec - chromosome to store
java.lang.ExceptionPersistence.store(org.jgap.Chromosome)
public void store(Activator a)
throws java.lang.Exception
store in interface Persistencea - activator to store
java.lang.ExceptionPersistence.store(com.anji.integration.Activator)
public void store(Run r)
throws java.lang.Exception
store in interface Persistencer - run to store
java.lang.ExceptionPersistence.store(com.anji.run.Run)
public static Chromosome chromosomeFromXml(Configuration config,
java.lang.String xml)
throws java.lang.Exception
config - xml -
java.lang.Exception
public static Chromosome chromosomeFromXml(Configuration config,
org.w3c.dom.Node chromNode)
config - chromNode -
public Chromosome loadChromosome(java.lang.String id,
Configuration config)
loadChromosome in interface PersistencePersistence.loadChromosome(java.lang.String,
org.jgap.Configuration)
public void deleteChromosome(java.lang.String id)
throws java.lang.Exception
Persistenceid
deleteChromosome in interface Persistenceid - id of chromosome to delete
java.lang.ExceptionPersistence.deleteChromosome(java.lang.String)public Genotype loadGenotype(Configuration config)
Persistence
loadGenotype in interface PersistencePersistence.loadGenotype(org.jgap.Configuration)public void startRun(java.lang.String aRunId)
Persistence
startRun in interface PersistencePersistence.startRun(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||