java.lang.Object
feynman.framework.simulation.Marshaller
- public class Marshaller
- extends java.lang.Object
Utility class to load the properties file that the user has defined. If
there is a switch to an XML format and using a real Marshalling/Unmarshalling
tool like Castor, then this class can easily be refactored to an adaptor class.
The constructor is private since this is a utility class so there is no instance
of this class to create or get. To use this class treat it just like the Math
utility class in the following manner:
Simulation simulation = Marshaller.unmarshall("Simulation.properties");
- Version:
- $Revision: 1.1.1.1 $ $Date: 2002/11/12 02:25:41 $
|
Constructor Summary |
private |
Marshaller()
This is a utility class so there is no instance of the class to be created or
retrieved. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
file
private static java.io.File file
fw
private static java.io.FileWriter fw
fin
private static java.io.FileInputStream fin
pw
private static java.io.PrintWriter pw
props
private static java.util.Properties props
Marshaller
private Marshaller()
- This is a utility class so there is no instance of the class to be created or
retrieved.
marshall
public static void marshall(Simulation sim,
java.lang.String outfile)
throws MarshallingException
- Method to save a serialized version of the simulation object.
unmarshall
public static Simulation unmarshall(java.lang.String infile)
throws MarshallingException
- Method to create a simulation object with attribute values specified by the
properties file descriptoin of the object.