Interface StateDirectorySaveable


public interface StateDirectorySaveable
This interface should be implemented by an Object that needs to save/restore its state to a directory. It is recommended that the implementor of this interface create and manage a sub-directory of the given "stateDir" parameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    mergeStateData(File[] stateDirs, File mergeDir)
    Merges all state data from the stateDirs to the mergeDir.
    void
    restoreState(File mergeDir)
    Restores the state from a directory that contains a "merged" state, as created by this Object's mergeStateData method.
    void
    saveState(File stateDir)
    Save the Object's state to the given directory.
  • Method Details

    • saveState

      void saveState(File stateDir) throws StateException
      Save the Object's state to the given directory.
      Parameters:
      stateDir - Location to save the state data.
      Throws:
      StateException
    • restoreState

      void restoreState(File mergeDir) throws StateException
      Restores the state from a directory that contains a "merged" state, as created by this Object's mergeStateData method.
      Parameters:
      mergeDir - Location to obtain the merged state data.
      Throws:
      StateException
    • mergeStateData

      void mergeStateData(File[] stateDirs, File mergeDir) throws StateException
      Merges all state data from the stateDirs to the mergeDir. Once completed, the Object should not need any information from the stateDirs - the information should all be within the mergeDir.
      Parameters:
      stateDirs - Current state directories
      mergeDir - New state merge directory
      Throws:
      StateException