package pojo;
import java.io.Serializable;
public class Book implements Comparable<Book>, Serializable{
	private int num; //���
	private String title; //����
	private String author; //����
	private boolean borrow = true; //�Ƿ�ɽ���
	private int time; //���Ĵ���
	
	public Book() {
		
	}
	
	public Book(int num, String title, String author, int time) {
		super();
		this.num = num;
		this.title = title;
		this.author = author;
		this.borrow = borrow;
		this.time = time;
	}
	
	public Book(int num, String title, String author) {
		super();
		this.num = num;
		this.title = title;
		this.author = author;
		this.borrow = borrow;
	}
	
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public boolean isBorrow() {
		return borrow;
	}
	public void setBorrow(boolean borrow) {
		this.borrow = borrow;
	}
	public int getTime() {
		return time;
	}
	public void setTime(int time) {
		this.time = time;
	}
	@Override
	public int compareTo(Book b) {
		// TODO Auto-generated method stub
		if(this.time > b.time){
			return -1;
		}else if(this.time < b.time){
			return 1;
		}
		return 0;
	}
}