⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 istorage.java

📁 一个在线学习系统的服务端SERVLET程序
💻 JAVA
字号:
package eols.storage.base;

import java.util.List;

/**
 * The general interface for storage operations, such as
 * add a new record, update a existing record, delete an
 * existing record, retrieving the specific record etc.
 *
 * For each operation, there is another corresponding
 * operation which takes a list as the parameter.
 *
 * @author Fasheng Qiu
 * @since 11/01/2007
 *
 */
public interface IStorage {

	/**
	 * Add a new record into the external storage file.
	 * For each sub-class, the parameter should be casted
	 * into the specific domain objects, such as Category,
	 * Course, etc.
	 *
	 * @param record The record to add into the external storage
	 * @return Whether the operation is successful
	 */
	public boolean addRecord(Object record);

	/**
	 * Update the existing record of the external storage file.
	 * For each sub-class, the parameter should be casted
	 * into the specific domain objects, such as Category,
	 * Course, etc.
	 *
	 * @param indicator The identifier of record to be updated.
	 * 					It can an integer, such as "id"; Or a String
	 * 					, such as "name"
	 * @param newRecord The record which contains new information
	 * @return Whether the operation is successful
	 */
	public boolean updateRecord(Object indicator, Object newRecord);

	/**
	 * Delete the existing record of the external storage file.
	 * For each sub-class, the parameter should be casted
	 * into the specific domain objects, such as Category,
	 * Course, etc.
	 *
	 * @param indicator The identifier of the record to be deleted.
	 * 					It can an integer, such as "id"; Or a String
	 * 					, such as "name"
	 * @return Whether the operation is successful
	 */
	public boolean deleteRecord(Object indicator);

	/**
	 * Get the specified record of the external storage file.
	 * For each sub-class, the parameter should be casted
	 * into the specific domain objects, such as Category,
	 * Course, etc.
	 *
	 * @param indicator The identifier of the record to be retrieved.
	 * 					It can an integer, such as "id"; Or a String
	 * 					, such as "name"
	 * @return Whether the operation is successful
	 */
	public Object getRecord(Object indicator);

	/**
	 * Add a list of new records into the external storage file.
	 *
	 * @param records The records to add into the external storage
	 * @return Whether the operation is successful
	 */
	public boolean addRecords(List records);

	/**
	 * Update a list of records in the external storage file.
	 *
	 * @param indicatorList	The list of identifiers of the records
	 * 						to be updated.
	 * @param records The records to be updated.
	 * 				  Each record has a corresponding indicator which
	 * 				  is stored in the indicatorList.
	 * @return Whether the operation is successful
	 */
	public boolean updateRecords(List indicatorList, List records);

	/**
	 * Delete a list of records in the external storage file.
	 *
	 * @param indicatorList	The list of identifiers of the records
	 * 						to be deleted.
	 * @return Whether the operation is successful
	 */
	public boolean deleteRecords(List indicatorList);

	/**
	 * Get all specified records of the external storage file.
	 * For each sub-class, the parameter should be casted
	 * into the specific domain objects, such as Category,
	 * Course, etc.
	 *
	 * @param indicator The identifier of the record to be retrieved.
	 * 					It can an integer, such as "id"; Or a String
	 * 					, such as "name"
	 * @return Whether the operation is successful
	 */
	public List getRecords(Object indicator);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -