lastlistuos.java

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

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

import dslib.exception.*;

/**	A descendant of interface BasicListUos with added methods to insert at the end and 
	set the last item. */
public interface LastListUos extends BasicListUos
{
	/**	The last item of the list. <br>
		PRECONDITION: <br>
		<ul>
			!isEmpty() 
		</ul> */
	public Object lastItem() throws ContainerEmptyUosException;

	/**	Set the last item of the list to x. <br>
		PRECONDITION: <br>
		<ul>
			!isEmpty()
		</ul>
		@param x item to replace the last item */
	public void setLastItem(Object x) throws ContainerEmptyUosException;

	/**	Insert x as the last item in the list. 
		@param x item to be inserted at the end of the list */
	public void insertLast(Object x);

}

⌨️ 快捷键说明

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