laser.util
Interface Persistent

All Known Subinterfaces:
AlphabetInterface<L>, ArtifactInterface, DFAInterface<L>, FSAInterface<L>, MutableDFAInterface<L>, MutableFSAInterface<L>, RunnableDFAInterface<L>, RunnableFSAInterface<L>
All Known Implementing Classes:
AbstractFSA, AbstractMutableFSA, AbstractRunnableFSA, Alphabet, IndexedAlphabet, MutableDFA, MutableFSA, RE, RunnableDFA, RunnableFSA

public interface Persistent

The Persistent interface allows the user to read/write the persistent form of an object.

NOTE: It permits us to change the implementation without affecting any of the tools which rely upon this functionality.

Author:
Heather M. Conboy (laser-software@cs.umass.edu)

Field Summary
static java.lang.String PER_EXTENSION
          The file extension to use for persistent files
static java.lang.String READ_PERSISTENT_METHOD_NAME
          The name of the readPersistent method
 
Method Summary
 void writePersistent(java.io.OutputStream out)
          Takes this object and outputs the persistent form of it to the given OutputStream.
 void writePersistent(java.lang.String filename)
          Takes this object and outputs the persistent form of it to the given file.
 

Field Detail

READ_PERSISTENT_METHOD_NAME

static final java.lang.String READ_PERSISTENT_METHOD_NAME
The name of the readPersistent method

NOTE: The following two methods should be provided: public static Persistent readPersistent (String filename) throws IOException, PersistentException; public static Persistent readPersistent (InputStream in) throws IOException, PersistentException;

See Also:
Constant Field Values

PER_EXTENSION

static final java.lang.String PER_EXTENSION
The file extension to use for persistent files

See Also:
Constant Field Values
Method Detail

writePersistent

void writePersistent(java.lang.String filename)
                     throws java.io.IOException,
                            PersistentException
Takes this object and outputs the persistent form of it to the given file.

Parameters:
filename - The name of the file to use
Throws:
java.io.IOException - if an I/O error occurs
PersistentException - if there is a problem with the persistent process

writePersistent

void writePersistent(java.io.OutputStream out)
                     throws java.io.IOException,
                            PersistentException
Takes this object and outputs the persistent form of it to the given OutputStream.

Parameters:
out - The OutputStream to use
Throws:
java.io.IOException - if an I/O error occurs
PersistentException - if there is a problem with the persistence process