ppJava.serie04.oceanlife
Class OceanFileOps

java.lang.Object
  extended by ppJava.serie04.oceanlife.OceanFileOps

public class OceanFileOps
extends java.lang.Object

Helper-class for file-operations


Constructor Summary
OceanFileOps()
           
 
Method Summary
static OceanInterface loadOceanObjectFile(java.lang.String filename, Ocean ocean)
          Reads a file of serialized oceanObjects and adds all items into the ocean
static void saveOceanObjectFile(java.lang.String filename, Ocean ocean)
          Serialize and writes all oceanObjects to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OceanFileOps

public OceanFileOps()
Method Detail

saveOceanObjectFile

public static void saveOceanObjectFile(java.lang.String filename,
                                       Ocean ocean)
                                throws java.io.IOException
Serialize and writes all oceanObjects to a file

Parameters:
filename -
Throws:
java.io.IOException

loadOceanObjectFile

public static OceanInterface loadOceanObjectFile(java.lang.String filename,
                                                 Ocean ocean)
                                          throws java.io.IOException,
                                                 java.lang.ClassNotFoundException
Reads a file of serialized oceanObjects and adds all items into the ocean

Parameters:
filename -
Returns:
a ocean with linked list of oceanObjects
Throws:
java.io.IOException
java.lang.ClassNotFoundException