speedscheduler.io
Class BinaryScheduleIO

java.lang.Object
  extended byspeedscheduler.io.BinaryScheduleIO
All Implemented Interfaces:
ScheduleIO

public class BinaryScheduleIO
extends java.lang.Object
implements ScheduleIO

An implementation of ScheduleIO that persists Schedules as binary serialized Java objects. TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates


Field Summary
protected  int defaultMaxDownloadRate
           
protected  int defaultMaxUploadRate
           
protected  java.util.Vector schedules
           
protected  boolean schedulesLoaded
           
 
Constructor Summary
BinaryScheduleIO()
           
 
Method Summary
 int getDefaultMaxDownloadRate()
           
 int getDefaultMaxUploadRate()
           
private  java.lang.String getSaveFileName()
          Helper function that tells us where to save the Schedules.
 java.util.Vector getSchedules()
          Fetches the loaded schedules.
 void loadSchedules()
          Loads the Schedules and default up/down rates from the saved file of binary Java Objects using an ObjectInputStream.
 void saveSchedules(java.util.Vector schedulesToSave, int defaultMaxUploadRate, int defaultMaxDownloadRate)
          Save these Schedules and default up/down rates to the persistent file using a vector of binary Java objects and the ObjectOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schedules

protected java.util.Vector schedules

defaultMaxUploadRate

protected int defaultMaxUploadRate

defaultMaxDownloadRate

protected int defaultMaxDownloadRate

schedulesLoaded

protected boolean schedulesLoaded
Constructor Detail

BinaryScheduleIO

public BinaryScheduleIO()
Method Detail

getSchedules

public java.util.Vector getSchedules()
Fetches the loaded schedules.

Specified by:
getSchedules in interface ScheduleIO

saveSchedules

public void saveSchedules(java.util.Vector schedulesToSave,
                          int defaultMaxUploadRate,
                          int defaultMaxDownloadRate)
                   throws java.io.IOException
Save these Schedules and default up/down rates to the persistent file using a vector of binary Java objects and the ObjectOutputStream.

Specified by:
saveSchedules in interface ScheduleIO
Parameters:
schedulesToSave -
defaultMaxUploadRate -
defaultMaxDownloadRate -
Throws:
java.io.IOException

loadSchedules

public void loadSchedules()
                   throws java.io.IOException
Loads the Schedules and default up/down rates from the saved file of binary Java Objects using an ObjectInputStream.

Specified by:
loadSchedules in interface ScheduleIO
Returns:
Throws:
java.io.IOException

getSaveFileName

private java.lang.String getSaveFileName()
Helper function that tells us where to save the Schedules.


getDefaultMaxUploadRate

public int getDefaultMaxUploadRate()
Specified by:
getDefaultMaxUploadRate in interface ScheduleIO
See Also:
ScheduleIO.getDefaultMaxUploadRate()

getDefaultMaxDownloadRate

public int getDefaultMaxDownloadRate()
Specified by:
getDefaultMaxDownloadRate in interface ScheduleIO
See Also:
ScheduleIO.getDefaultMaxDownloadRate()