⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listprinter.java

📁 国外的数据结构与算法分析用书
💻 JAVA
字号:
package simple;

/**	ListPrinter which prints the list as it is traversed.  The list output
	includes a leading (, commas between the items and a trailing ).  */
public class ListPrinter extends ListTraverser
{
	/**	Create a new list Traverser 
		Analysis: Time = O(1) */
	public ListPrinter() {}

	/**	Actions done to an item 
		Analysis: Time = O(1) */
	public void itemActions(Object item)
	{
		System.out.print(item);
	}

	/**	Actions to be performed before each traversal
		Analysis: Time = O(1) */
	public void beforeActions()
	{
		System.out.print("(");
	}

	/**	Actions to be performed between items 
		Analysis: Time = O(1) */
	public void betweenActions()
	{
		System.out.print(", ");
	}
      
	/**	Actions to be performed after a traversal 
		Analysis: Time = O(1) */
	public void afterActions()
	{
		System.out.print(")");
	}
} 

⌨️ 快捷键说明

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