The Encog Project

org.encog.neural.persist
Class EncogPersistedCollection

java.lang.Object
  extended by org.encog.neural.persist.EncogPersistedCollection

public class EncogPersistedCollection
extends java.lang.Object

An EncogPersistedCollection holds a collection of EncogPersistedObjects. This allows the various neural networks and some data sets to be peristed. They are persisted to an XML form.

Author:
jheaton

Constructor Summary
EncogPersistedCollection()
           
 
Method Summary
 void add(EncogPersistedObject obj)
          Add an EncogPersistedObject to the collection.
static void addAttribute(org.xml.sax.helpers.AttributesImpl atts, java.lang.String name, java.lang.String value)
           
 void clear()
          Clear the collection.
static org.xml.sax.helpers.AttributesImpl createAttributes(EncogPersistedObject obj)
           
static Persistor createPersistor(java.lang.String className)
          Create a persistor object.
 void delete(java.lang.String name)
           
 EncogPersistedObject find(java.lang.String name)
          Called to search all Encog objects in this collection for one with a name that passes what was passed in.
 java.lang.String getEncogVersion()
           
 int getFileVersion()
           
 java.util.List<EncogPersistedObject> getList()
           
 java.lang.String getPlatform()
           
 void load(java.io.InputStream is)
          Load from an input stream.
 void load(java.lang.String filename)
          Load from a file.
 void save(java.io.OutputStream os)
          Save to an output stream.
 void save(java.lang.String filename)
          Save to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncogPersistedCollection

public EncogPersistedCollection()
Method Detail

createPersistor

public static Persistor createPersistor(java.lang.String className)
Create a persistor object. These objects know how to persist certain types of classes.

Parameters:
className - The name of the class to create a persistor for.
Returns:
The persistor for the specified class.

add

public void add(EncogPersistedObject obj)
Add an EncogPersistedObject to the collection.

Parameters:
obj - The object to add.

clear

public void clear()
Clear the collection.


getEncogVersion

public java.lang.String getEncogVersion()
Returns:
the encogVersion

getFileVersion

public int getFileVersion()
Returns:
the fileVersion

getList

public java.util.List<EncogPersistedObject> getList()
Returns:
the list

getPlatform

public java.lang.String getPlatform()
Returns:
the platform

load

public void load(java.io.InputStream is)
Load from an input stream.

Parameters:
is - The stream to load from.

load

public void load(java.lang.String filename)
Load from a file.

Parameters:
filename - The filename to load from.

save

public void save(java.io.OutputStream os)
Save to an output stream.

Parameters:
os - The stream to save to.

save

public void save(java.lang.String filename)
Save to a file.

Parameters:
filename - The filename to save to.

addAttribute

public static void addAttribute(org.xml.sax.helpers.AttributesImpl atts,
                                java.lang.String name,
                                java.lang.String value)

createAttributes

public static org.xml.sax.helpers.AttributesImpl createAttributes(EncogPersistedObject obj)

find

public EncogPersistedObject find(java.lang.String name)
Called to search all Encog objects in this collection for one with a name that passes what was passed in.

Parameters:
name - The name we are searching for.
Returns:
The Encog object with the correct name.

delete

public void delete(java.lang.String name)

The Encog Project