📄 pkeyeddictuos.java
字号:
/* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -