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

📄 findbooksbeans.java

📁 一个简单的网上订书系统 java的课程设计
💻 JAVA
字号:
package funcBeans;

import beans.Book;
import java.util.*;
import connector.Searcher;;

public class FindBooksBeans {

	private Searcher s = new Searcher(); 
	
	private String method;

	private String context;

	private ArrayList<Book> books;

	public FindBooksBeans() {
		method = null;
		context = null;
		books = new ArrayList<Book>();
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getContext() {
		return context;
	}

	public void setContext(String context) {
		this.context = context;
	}

	public ArrayList<Book> getBooks() {
		if (method == null)
			return null;
		if (method.trim().equals("title"))
			books = s.searchBookByTitle(context);
		else if(method.trim().equals("author"))
			books = s.searchBookByAuthor(context);
		System.err.println(books);
		return books;
	}

	public void setBooks(ArrayList<Book> books) {
		this.books = books;
	}
	
	public Book getBookById(String bid) {
		return s.getBookByID(bid);
	}
	
	public double getDiscount(String bid) {
		return 0.8;		// something important should be done here
	}
	
	public ArrayList<Book> top10BySale() {
		return s.top10BySale();
	}
	
	public ArrayList<Book> top10ByDate() {
		return s.top10ByDate();
	}

}

⌨️ 快捷键说明

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