org.encog.persist.persistors.generic
Class GenericPersistor

java.lang.Object
  extended by org.encog.persist.persistors.generic.GenericPersistor
All Implemented Interfaces:
Persistor

public class GenericPersistor
extends Object
implements Persistor

An Encog perisistor that can be used with any object that supports the Encog generic persistence. Simply provide the class to the constructor, and return an instance of this object in the getPersistor call. When loading an object, Encog will attempt to use this class if no other suitable persistor can be found.


Constructor Summary
GenericPersistor(Class<?> clazz)
          Construct a generic persistor for the specified class.
 
Method Summary
 EncogPersistedObject load(ReadXML in)
          Load from the specified node.
 void save(EncogPersistedObject obj, WriteXML out)
          Save the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericPersistor

public GenericPersistor(Class<?> clazz)
Construct a generic persistor for the specified class.

Parameters:
clazz - The class to construct a persistor for.
Method Detail

load

public EncogPersistedObject load(ReadXML in)
Load from the specified node.

Specified by:
load in interface Persistor
Parameters:
in - The node to load from.
Returns:
The EncogPersistedObject that was loaded.

save

public void save(EncogPersistedObject obj,
                 WriteXML out)
Save the specified object.

Specified by:
save in interface Persistor
Parameters:
obj - The object to save.
out - The XML object.


Copyright © 2011. All Rights Reserved.