org.encog.persist
Class EncogDirectoryPersistence
- java.lang.Object
-
- org.encog.persist.EncogDirectoryPersistence
-
public class EncogDirectoryPersistence extends java.lang.ObjectHandles Encog persistence for a directory. This is the usual mode where each resource is stored in a separate EG file.
-
-
Constructor Summary
Constructors Constructor and Description EncogDirectoryPersistence(java.io.File parent)Construct the object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetEncogType(java.lang.String name)Get the type of an Encog object in an EG file, without the need to read the entire file.java.io.FilegetParent()java.lang.ObjectloadFromDirectory(java.lang.String name)Load a file from the directory that this object refers to.static java.lang.ObjectloadObject(java.io.File file)Load the specified object.static java.lang.ObjectloadObject(java.io.InputStream is)Load an object from an input stream.static java.lang.ObjectloadResourceObject(java.lang.String res)Load an EG object as a reousrce.static voidsaveObject(java.io.File filename, java.lang.Object obj)Save the specified object.static voidsaveObject(java.io.OutputStream os, java.lang.Object obj)Save the specified object.voidsaveToDirectory(java.lang.String name, java.lang.Object obj)Save a file to the directory that this object refers to.
-
-
-
Constructor Detail
-
EncogDirectoryPersistence
public EncogDirectoryPersistence(java.io.File parent)
Construct the object.- Parameters:
parent- The directory to use.
-
-
Method Detail
-
loadResourceObject
public static java.lang.Object loadResourceObject(java.lang.String res)
Load an EG object as a reousrce.- Parameters:
res- The resource name.- Returns:
- The loaded object.
-
loadObject
public static java.lang.Object loadObject(java.io.File file)
Load the specified object.- Parameters:
file- The file to load.- Returns:
- The loaded object.
-
loadObject
public static java.lang.Object loadObject(java.io.InputStream is)
Load an object from an input stream.- Parameters:
is- The input stream to read from.- Returns:
- The loaded object.
-
saveObject
public static void saveObject(java.io.File filename, java.lang.Object obj)Save the specified object.- Parameters:
filename- The filename to save to.obj- The Object to save.
-
saveObject
public static void saveObject(java.io.OutputStream os, java.lang.Object obj)Save the specified object.- Parameters:
os- The output stream to write to.obj- The object to save.
-
getEncogType
public java.lang.String getEncogType(java.lang.String name)
Get the type of an Encog object in an EG file, without the need to read the entire file.- Parameters:
name- The filename to read.- Returns:
- The type.
-
getParent
public final java.io.File getParent()
- Returns:
- The directory.
-
loadFromDirectory
public final java.lang.Object loadFromDirectory(java.lang.String name)
Load a file from the directory that this object refers to.- Parameters:
name- The name to load.- Returns:
- The object.
-
saveToDirectory
public final void saveToDirectory(java.lang.String name, java.lang.Object obj)Save a file to the directory that this object refers to.- Parameters:
name- The name to load.obj- The object to save.
-
-
DMelt 3.0 © DataMelt by jWork.ORG