|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object yawn.io.xml.XmlStorage
public class XmlStorage
Implementation of INeuralNetworkConfigStorage
backed by xml
files, one per neural network configuration.
The xml file names follow the pattern ${networkConfigId}-config.xml
$Id: XmlStorage.java,v 1.3 2005/04/07 17:28:28 supermarti Exp $
Constructor Summary | |
---|---|
XmlStorage()
|
|
XmlStorage(XmlContext context)
|
Method Summary | |
---|---|
protected java.lang.Object |
deSerializeObject(java.io.File file)
|
void |
flush()
|
java.lang.String |
generateKey(java.lang.Object object)
|
java.lang.Object |
get(java.lang.String key)
Returns the object stored in the file named as the key . |
java.lang.Object[] |
getAll()
Returns all objects in the repository. |
IContext |
getContext()
|
void |
insert(java.lang.Object object,
java.lang.String key)
Inserts an instance of a IPersistent implementor in the
underlying storage. |
protected java.io.File |
prepareFile(java.lang.String key)
|
protected void |
serializeObject(java.lang.Object object,
java.io.File file)
|
void |
setContext(IContext context)
|
void |
update(java.lang.Object object,
java.lang.String key)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlStorage(XmlContext context)
public XmlStorage()
Method Detail |
---|
public void setContext(IContext context)
setContext
in interface IStorage
IStorage.setContext(yawn.io.IContext)
public IContext getContext()
getContext
in interface IStorage
IStorage.getContext()
public void insert(java.lang.Object object, java.lang.String key) throws StorageException, DuplicateKeyException
IStorage
IPersistent
implementor in the
underlying storage.
insert
in interface IStorage
object
- The IPersistent
implementor instance to store.
StorageException
DuplicateKeyException
IStorage.insert(java.lang.Object, java.lang.String)
protected void serializeObject(java.lang.Object object, java.io.File file) throws StorageException
StorageException
public java.lang.String generateKey(java.lang.Object object)
generateKey
in interface IStorage
IStorage.generateKey(java.lang.Object)
protected java.io.File prepareFile(java.lang.String key)
public void update(java.lang.Object object, java.lang.String key) throws KeyNotPresentException, StorageException
update
in interface IStorage
KeyNotPresentException
StorageException
IStorage.update(java.lang.Object, java.lang.String)
public java.lang.Object get(java.lang.String key) throws StorageException, KeyNotPresentException
key
.
The base class of this object is specified in
XmlContext.getRootSerializationClass()
.
get
in interface IStorage
IPersistent
implementor instance that matches
the provided id, or null if not matching instance is
found.
StorageException
KeyNotPresentException
XmlContext.getRootSerializationClass()
,
IStorage.get(java.lang.String)
protected java.lang.Object deSerializeObject(java.io.File file) throws StorageException
StorageException
public java.lang.Object[] getAll() throws StorageException
getAll
in interface IStorage
StorageException
IStorage.getAll()
public void flush()
flush
in interface IStorage
IStorage.flush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |