JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class Saver

java.lang.Object
  extended bygov.nasa.alsUtility.Saver
All Implemented Interfaces:
java.io.Serializable

public class Saver
extends java.lang.Object
implements java.io.Serializable

This class is intended to buffer up many timesteps or generations of data and then save them as an array using java serialization. The file name is appended with an ASCII number that should be in alphabetical order. Every save call creates an additional file in a specified directory.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector data
           
protected  java.lang.String directoryName
          directory to save data in
protected  int numberOfSaves
           
 
Constructor Summary
Saver(java.lang.String s)
           
 
Method Summary
 void buffer(java.lang.Object object)
          add object to the buffer for later saving
 void save()
          save an array of objects that were buffered
 void save(java.io.Serializable object)
          save an single object
 void setNumber(int number)
          set the number used to name files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directoryName

protected java.lang.String directoryName
directory to save data in


numberOfSaves

protected int numberOfSaves

data

protected java.util.Vector data
Constructor Detail

Saver

public Saver(java.lang.String s)
Parameters:
s - directory name to save data in. Directory will be created
Method Detail

buffer

public void buffer(java.lang.Object object)
add object to the buffer for later saving


save

public void save()
save an array of objects that were buffered


save

public void save(java.io.Serializable object)
save an single object


setNumber

public void setNumber(int number)
set the number used to name files


JavaGenes, NASA Ames. Written largely by Al Globus