eu.gressly.io
Class Persistent

java.lang.Object
  extended by eu.gressly.io.Persistent

public class Persistent
extends java.lang.Object

Persistent This class is used to hold the data permanent. Call "load()" at startup of the application and call "save()" at the end.


Constructor Summary
Persistent()
           
 
Method Summary
static java.lang.Object load(java.lang.String persistentFileName)
          Load a previously saved object.
static void save(java.lang.Object data, java.lang.String persistentFileName)
          Save any (serializable) object to a file with the above filename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Persistent

public Persistent()
Method Detail

save

public static void save(java.lang.Object data,
                        java.lang.String persistentFileName)
                 throws java.io.IOException
Save any (serializable) object to a file with the above filename

Parameters:
data - The object to save
Throws:
java.io.IOException

load

public static java.lang.Object load(java.lang.String persistentFileName)
                             throws java.lang.Exception
Load a previously saved object. The filename is static in this class and will never be changed.

Returns:
The deserialized object.getPersistentFileName
Throws:
java.lang.Exception