sophware.home.io
Class FileHomeStorage

java.lang.Object
  extended by sophware.home.io.MemoryHomeStorage
      extended by sophware.home.io.PersistentHomeStorage
          extended by sophware.home.io.FileHomeStorage
All Implemented Interfaces:
HomeStorage

public class FileHomeStorage
extends PersistentHomeStorage

The FileHomeStorage is a persistent implementation of the HomeStorage interface.

Version:
1.0, 03/19/07
Author:
Russell Soph

Constructor Summary
FileHomeStorage(java.io.File storage)
          Constructs FileHomeStorage
 
Method Summary
 void close()
          Closes the resources associate with this storage
 java.io.ObjectInputStream getInputStream()
          Get the ObjectInputStream from which the HomeStorage is initialized
 java.io.ObjectOutputStream getOutputStream()
          Get the ObjectOutputStream to which the HomeStorage is saved
 
Methods inherited from class sophware.home.io.PersistentHomeStorage
flush, open
 
Methods inherited from class sophware.home.io.MemoryHomeStorage
add, contains, get, get, getAll, getAll, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHomeStorage

public FileHomeStorage(java.io.File storage)
Constructs FileHomeStorage

Parameters:
storage - the file used to store objects
Method Detail

getInputStream

public java.io.ObjectInputStream getInputStream()
                                         throws java.io.IOException
Description copied from class: PersistentHomeStorage
Get the ObjectInputStream from which the HomeStorage is initialized

Specified by:
getInputStream in class PersistentHomeStorage
Returns:
ObjectInputStream associated with this file
Throws:
java.io.IOException

getOutputStream

public java.io.ObjectOutputStream getOutputStream()
                                           throws java.io.IOException
Description copied from class: PersistentHomeStorage
Get the ObjectOutputStream to which the HomeStorage is saved

Specified by:
getOutputStream in class PersistentHomeStorage
Returns:
ObjectOutputStream associated with this file
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the resources associate with this storage

Specified by:
close in interface HomeStorage
Overrides:
close in class PersistentHomeStorage
Throws:
java.io.IOException