simplelistuos.java

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

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

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

/**	A simple list interface with methods to access, insert and delete 
	items at the front of the list.  It also has a test for empty 
	and a wipeOut method. */ 
public interface SimpleListUos extends ContainerUos
{
	/**	Insert x as the first element in the list. <br>
		PRECONDITION: <br>
		<ul>
			!isFull()
		</ul> 
		@param x item to be inserted in the list */ 
	public void insertFirst(Object x) throws ContainerFullUosException;

	/**	Return the first item. <br>
		PRECONDITION: <br>
		<ul>
			!isEmpty() 
		</ul> */
	public Object firstItem() throws ContainerEmptyUosException;

	/**	Delete the first item from the list. <br>
		PRECONDITION: <br>
		<ul>
			!isEmpty() 
		</ul> */
	public void deleteFirst() throws ContainerEmptyUosException;

	/**	Returns a semi-deep clone of the list structure. */
	public SimpleListUos listClone();
}

⌨️ 快捷键说明

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