|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 Persistence
init
in interface Configurable
props
- configuration parametersprotected java.lang.String fullPath(java.lang.String type, java.lang.String key)
type
and key
.
type
- key
-
public void reset()
Persistence
reset
in interface Persistence
Persistence.reset()
public void store(Chromosome c) throws java.lang.Exception
store
in interface Persistence
c
- chromosome to store
java.lang.Exception
Persistence.store(org.jgap.Chromosome)
public void store(Activator a) throws java.lang.Exception
store
in interface Persistence
a
- activator to store
java.lang.Exception
Persistence.store(com.anji.integration.Activator)
public void store(Run r) throws java.lang.Exception
store
in interface Persistence
r
- run to store
java.lang.Exception
Persistence.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 Persistence
Persistence.loadChromosome(java.lang.String,
org.jgap.Configuration)
public void deleteChromosome(java.lang.String id) throws java.lang.Exception
Persistence
id
deleteChromosome
in interface Persistence
id
- id of chromosome to delete
java.lang.Exception
Persistence.deleteChromosome(java.lang.String)
public Genotype loadGenotype(Configuration config)
Persistence
loadGenotype
in interface Persistence
Persistence.loadGenotype(org.jgap.Configuration)
public void startRun(java.lang.String aRunId)
Persistence
startRun
in interface Persistence
Persistence.startRun(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |