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

📄 lendlist.java

📁 使用swing做的熟悉控件使用的DEMO
💻 JAVA
字号:
package book;import java.util.HashSet;import java.util.Iterator;import java.util.Collection;import java.util.ArrayList;import userexception.*;/*** class LendList*/public class LendList {	private static LendList instance;	private ArrayList books;		//constructor	private LendList() {		books = new ArrayList();	}	//static method to get the instance	public synchronized static LendList getInstance() {		if(instance == null) instance = new LendList();		return instance;	}	//add a book to the lendlist	public void addBook(Book bk) {		books.add(bk);	}	//remove a book from the lendlist	public void removeBook(Book bk) throws BookNotFoundException {		int idx = books.indexOf(bk);		if(idx != -1) {			books.remove(books.indexOf(bk));		}else {			throw new BookNotFoundException();		}	}}

⌨️ 快捷键说明

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