util
Interface Preserving

All Superinterfaces:
ExitCleaning
All Known Subinterfaces:
StatePreserving
All Known Implementing Classes:
AlarmWatch, BiasMaster, CountDownTrigger, CountDownWatch, CountingTrigger, DarkMaster, ExposureCount, ExposureTimeLeft, FlatMaster, FocusQuality, IntegerId, PointingScheduler, RollOverWatch, StopWatch, TrackTime, TransferListener, Unique

public interface Preserving
extends ExitCleaning

Object that can preserve their current state on exit, thus they are also exit cleaning. In almost any case these classes will also be initializable, to allow restoration on init, nevertheless this interface is not extended here. The normal curse of action will be a state file, pointed to by some key in a PropertySupplying instance, which the object is serialized in during preserve and deserialized during restore. In this case it may also be advisable to extend the Serializable interface.

See Also:
Initializable

Method Summary
 boolean preserve()
          Preserves the current state of this parameter.
 boolean restore()
          Restores the last state of this parameter.
 
Methods inherited from interface util.ExitCleaning
exit
 

Method Detail

preserve

boolean preserve()
Preserves the current state of this parameter. This method is called during exit.

Returns:
false, if preserving the current state was not possible

restore

boolean restore()
Restores the last state of this parameter. This is the state the parameter was in during the last call to #preserve.

Returns:
False, if restoring the value was not possible.