basiclistuos.java

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

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

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

/**	A descendant of interface SimpleListUos with added methods
	to set the first item, and to access and set the first
	remainder of the list. */
public interface BasicListUos extends SimpleListUos
{
	/**	Set the first item to x. <br> 
		PRECONDITION: <br>
		<ul>
			!isEmpty()
		</ul>
		@param x item to replace the first item */
	public void setFirstItem(Object x) throws ContainerEmptyUosException;
 
	/**	The list formed by excluding the first item. <br>
		PRECONDITION: <br>
		<ul>
			!isEmpty() 
		</ul> */
	public BasicListUos firstRemainder() throws ContainerEmptyUosException;

	/**	Set the list to be list rem preceded by firstItem. <br>
		PRECONDITION: <br>
		<ul>
			!isEmpty()
		</ul>
		@param rem the replacement list for firstRemainder() */
	public void setFirstRemainder(BasicListUos rem) throws ContainerEmptyUosException;

	/**	Linear iterator for list initialized to first item. */
	public LinearIteratorUos iterator();
	
} 

⌨️ 快捷键说明

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