📄 book.java
字号:
package domain;
public class Book extends Goods {
public static void main(String[] args) {
}
/**
*
*/
public Book() {
super();
this.category[0] = "图书";
}
/**
* @param id
* @param name
* @param price
* @param number
* @param saler
* @param author
* @param press
* @param edition
* @param isbn
* @param categoryNum
*/
public Book(String id, String name, double price, int number, User saler,
String author, String press, byte edition, String isbn, String categoryNum) {
super(id, name, price, number, saler);
this.author = author;
this.press = press;
this.editon = edition;
this.isbn = isbn;
this.categoryNum = categoryNum;
this.category[0] = "图书";
}
/**
* @param id
* @param name
* @param price
* @param number
* @param saler
* @param category
* @param author
* @param press
* @param edition
* @param isbn
* @param categoryNum
*/
public Book(String id, String name, double price, int number, User saler,
String author, String press, byte edition, String isbn, String categoryNum,
String[] category) {
super(id, name, price, number, saler, category);
this.author = author;
this.press = press;
this.editon = edition;
this.isbn = isbn;
this.categoryNum = categoryNum;
this.category[0] = "图书";
}
/**
* @param id
* @param name
* @param price
* @param number
* @param saler
* @param category
* @param author
* @param press
* @param edition
* @param isbn
* @param categoryNum
* @param isReleased
*/
public Book(String id, String name, double price, int number, User saler,
String author, String press, String isbn, String categoryNum, byte edition,
String[] category, boolean isReleased) {
super(id, name, price, number, saler, category, isReleased);
this.author = author;
this.press = press;
this.isbn = isbn;
this.categoryNum = categoryNum;
this.editon = edition;
this.category[0] = "图书";
}
/**
* @return Returns the author.
*/
public String getAuthor() {
return author;
}
/**
* @param author The author to set.
*/
public void setAuthor(String author) {
this.author = author;
}
/**
* @return Returns the categoryNum.
*/
public String getCategoryNum() {
return categoryNum;
}
/**
* @param categoryNum The categoryNum to set.
*/
public void setCategoryNum(String categoryNum) {
this.categoryNum = categoryNum;
}
/**
* @return Returns the editon.
*/
public byte getEditon() {
return editon;
}
/**
* @param editon The editon to set.
*/
public void setEditon(byte editon) {
this.editon = editon;
}
/**
* @return Returns the isbn.
*/
public String getIsbn() {
return isbn;
}
/**
* @param isbn The isbn to set.
*/
public void setIsbn(String isbn) {
this.isbn = isbn;
}
/**
* @return Returns the press.
*/
public String getPress() {
return press;
}
/**
* @param press The press to set.
*/
public void setPress(String press) {
this.press = press;
}
public boolean equals(Book book) {
if (book == null)
return (this == null);
else
return (book.id == this.id);
}
public boolean equals(Object o) {
if (o instanceof Book)
return equals(((Book)o));
else
return false;
}
String author = null; /*图书作者*/
String press = null; /*出版社*/
byte editon = 0; /*图书版本*/
String isbn = null; /*国际统一图书编号*/
String categoryNum = null; /*中国图书分类号*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -