The Encog Project

org.encog.persist.location
Class ResourcePersistence

java.lang.Object
  extended by org.encog.persist.location.ResourcePersistence
All Implemented Interfaces:
PersistenceLocation

public class ResourcePersistence
extends java.lang.Object
implements PersistenceLocation

A location that allows Encog objects to be read from a resource. This location only supports read operations, so the Encog resource is usually created first as a file and then embedded in the application as a resource.

Author:
jheaton

Constructor Summary
ResourcePersistence(java.lang.String resource)
          Construct a location to read from the specified resource.
 
Method Summary
 java.io.InputStream createInputStream()
          Create an input stream to read from the resource.
 java.io.OutputStream createOutputStream()
          Write operations are not supported for resource persistence.
 void delete()
          Delete operations are not supported for resource persistence.
 boolean exists()
          Exist is not supported for resource persistence.
 void renameTo(PersistenceLocation toLocation)
          Rename is not supported for resource persistence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourcePersistence

public ResourcePersistence(java.lang.String resource)
Construct a location to read from the specified resource.

Parameters:
resource - The resource to read from.
Method Detail

createInputStream

public java.io.InputStream createInputStream()
Create an input stream to read from the resource.

Specified by:
createInputStream in interface PersistenceLocation
Returns:
An input stream.

createOutputStream

public java.io.OutputStream createOutputStream()
Write operations are not supported for resource persistence.

Specified by:
createOutputStream in interface PersistenceLocation
Returns:
Nothing.

delete

public void delete()
Delete operations are not supported for resource persistence.

Specified by:
delete in interface PersistenceLocation

exists

public boolean exists()
Exist is not supported for resource persistence.

Specified by:
exists in interface PersistenceLocation
Returns:
Nothing.

renameTo

public void renameTo(PersistenceLocation toLocation)
Rename is not supported for resource persistence.

Specified by:
renameTo in interface PersistenceLocation
Parameters:
toLocation - Not used.

The Encog Project