pkeyeddictuos.java

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

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

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

/**	A keyed Dictionary class that stores items and their keys.  
	Key-item pairs can be inserted, and an item deleted and 
	obtained by its key value.  It also includes a 
	KeyedLinearIteratorUos to move through the dictionary, and deleteItem 
	to delete the current item. It also has a search procedure and a 
	frequency function. */
public interface PKeyedDictUos extends PKeyedBasicDictUos, KeyedLinearIteratorUos, SavableCursorUos
{	
	/**	Move to the item with key i or else set to !itemExists.
		@param i key being sought */
	public void search(Comparable i);

	/**	Delete the current item from the data structure. 
		PRECONDITION: <br>
		<ul>
			itemExists() 
		</ul> */
	public void deleteItem() throws NoCurrentItemUosException;
	
	/**	The number of times key i occurs within the dictionary.
		@param i key to check how often it occurs */
  	public int frequency(Comparable i);

	/**	Change the item to another item with the same key. <br>
		PRECONDITION:  <br>
		<ul>
			itemExists() 
		</ul> 
		@param x item to replace the current item */
	public void setItem(Object x) throws NoCurrentItemUosException;
} 

⌨️ 快捷键说明

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