资源简介
图书管理系统的AndroidApp实现,Android程序设计大作业,仅供参考
代码片段和文件信息
package control;
import model.Book;
import model.BookList;
public class BookController {
public boolean addBook(String id String name String price) {
BookList bookList = BookList.getBookList();
int i = 0;
for (; i < bookList.size(); ++i) {
Book book2 = bookList.get(i);
String bid = book2.getId();
if (bid.equals(id)) {
break;
}
}
if (i == bookList.size()) {
Book book = new Book(id name price);
bookList.add(book);
return true;
}
return false;
}
public BookList listBook() {
BookList bookList = BookList.getBookList();
return bookList;
}
public Book searchBook(String name) {
BookList bookList = BookList.getBookList();
for (int i = 0; i < bookList.size(); ++i) {
Book book2 = bookList.get(i);
if (book2.getName().equals(name)) {
return book2;
}
}
return null;
}
public boolean deleteBook(String name) {
BookList bookList = BookList.getBookList();
for (int i = 0; i < bookList.size(); ++i) {
Book book2 = bookList.get(i);
if (book2.getName().equals(name)) {
bookList.remove(i);
return true;
}
}
return false;
}
public boolean setBook(String id String name String price) {
BookList bookList = BookList.getBookList();
for (int i = 0; i < bookList.size(); ++i) {
Book book2 = bookList.get(i);
if (book2.getId().equals(id)) {
Book book = new Book(id name price);
bookList.set(i book);
return true;
}
}
return false;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 301 2018-11-19 18:04 JavaBookProject\.classpath
文件 391 2018-11-19 18:04 JavaBookProject\.project
文件 598 2018-11-19 18:04 JavaBookProject\.settings\org.eclipse.jdt.core.prefs
文件 2017 2018-11-19 18:46 JavaBookProject\bin\control\BookController.class
文件 1439 2018-11-19 18:18 JavaBookProject\bin\model\Book.class
文件 113 2018-11-19 18:10 JavaBookProject\bin\model\BookInterface.class
文件 994 2018-11-19 18:43 JavaBookProject\bin\model\BookList.class
文件 3674 2018-11-19 18:46 JavaBookProject\bin\view\BookApp.class
文件 1551 2018-11-19 18:46 JavaBookProject\src\control\BookController.java
文件 800 2018-11-19 18:18 JavaBookProject\src\model\Book.java
文件 57 2018-11-19 18:10 JavaBookProject\src\model\BookInterface.java
文件 529 2018-11-19 18:43 JavaBookProject\src\model\BookList.java
文件 2879 2018-11-19 18:46 JavaBookProject\src\view\BookApp.java
目录 0 2018-11-19 18:46 JavaBookProject\bin\control
目录 0 2018-11-19 18:10 JavaBookProject\bin\model
目录 0 2018-11-19 18:08 JavaBookProject\bin\view
目录 0 2018-11-19 18:46 JavaBookProject\src\control
目录 0 2018-11-19 18:10 JavaBookProject\src\model
目录 0 2018-11-19 18:08 JavaBookProject\src\view
目录 0 2018-11-19 18:04 JavaBookProject\.settings
目录 0 2018-11-19 18:05 JavaBookProject\bin
目录 0 2018-11-19 18:05 JavaBookProject\src
目录 0 2018-11-19 18:04 JavaBookProject
----------- --------- ---------- ----- ----
15343 23
评论
共有 条评论