📄 persistent.java
字号:
/*
* Gary Cornell and Cay S. Horstmann, Core Java (Book/CD-ROM)
* Published By SunSoft Press/Prentice-Hall
* Copyright (C) 1996 Sun Microsystems Inc.
* All Rights Reserved. ISBN 0-13-565755-5
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for NON-COMMERCIAL purposes
* and without fee is hereby granted provided that this
* copyright notice appears in all copies.
*
* THE AUTHORS AND PUBLISHER MAKE NO REPRESENTATIONS OR
* WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS
* AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED
* BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*/
/**
* @version 1.00 07 Feb 1996
* @author Cay Horstmann, modified by Roland E. Schmid
*/
package sfclasses;
import java.io.*;
/**
* A class must implement the Persistent interface for its objects
* to be storable. When saving an object, the object's write method
* is called and when loading an object, the object's read method
* is called.
* @see PersistentInputStream
* @see PersistentOutputStream
*/
public abstract interface Persistent
{
/**
* The implementation of the write() method must write all data
* that is part of the object's persistent state to the stream
* given as parameter. The methods provided by PersistentOutputStream
* must be used to write the data.
* @see PersistentOutputStream
*/
public void write(PersistentOutputStream os);
/**
* The implementation of the read() method must restore the data
* in the order written by the write() method before. The methods
* provided by PersistentInputStream must be used to read the data.
* @see PersistentInputStream
*/
public void read(PersistentInputStream is)
throws java.io.IOException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -