save_state Implementation
For example, for a spreadsheet it may not be necessary to save all entries if some values can simply be recomputed. The save_state implementation for a class Example that has integer member variables called A, B and C might be implemented as in Example 1.2, “save_state Implementation�. Example 1.2. save_state Implementation public boolean save_state(OutputObjectState o) { if (!super.save_state(o)) return false; try { o.packInt(A); o.packInt(B); o.packInt(C)); } catch (Exception e) { return false; } return true; } Note it is necessary for all save_state and restore_state methods to call super.save_state and super.restore_state. This is to cater for improvements in the crash recovery mechanisms.