basicdictuos.java

来自「国外的数据结构与算法分析用书」· Java 代码 · 共 42 行

JAVA
42
字号
/* BasicDictUos.java
 * ---------------------------------------------
 * Copyright (c) 2001 University of Saskatchewan
 * All Rights Reserved
 * --------------------------------------------- */
 
package dslib.dictionary;

import dslib.base.*;
import dslib.exception.*;

/**	A Container class that contains the most basic dictionary 
	capabilities: has, obtain, insert, delete, and isEmpty. 
	All classes that implement this interface will be bags. */
public interface BasicDictUos extends MembershipUos
{
	/**	An item from the dictionary with membershipEquals(item,y). <br>
		PRECONDITION: <br>
		<ul>
			has(y)
		</ul>
		@param y item to obtain from the dictionary */
	public Object obtain(Object y) throws ItemNotFoundUosException;
 
	/**	Insert x into the dictionary. <br>
		PRECONDITION: <br>
		<ul>
			!isFull()
			!((this instanceof SetDictUos) && has(x))
		</ul>
		@param x item to be inserted into the dictionary */
	public void insert(Object x) throws ContainerFullUosException, DuplicateItemsUosException;
 
	/**	Delete the item x. <br>
		PRECONDITION: <br>
		<ul>
			has(y)
		</ul>
		@param x item to be deleted from the dictionary */
	public void delete(Object x) throws ItemNotFoundUosException;
}	

⌨️ 快捷键说明

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