|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Book2
Book2 class, which is misnomer because it really has the functionality of BookInLibrary (info about book per se plus info about status of one copy of that book in some particular library). Date started 2004.Oct.04 for Lab#1, amended for Lab#2 starting Oct.26 Part of Blab2.java (Second = 035B Java college-class, lab assignment #2)
Field Summary | |
private java.lang.String |
author
|
private int |
bkid
|
private java.util.Calendar |
duedate
|
private java.lang.String |
isbn
|
private java.lang.String |
loanedTo
|
private java.util.Vector |
reservedBy
|
(package private) static long |
serialVersionUID
|
private java.lang.String |
title
|
Constructor Summary | |
Book2(int bkid,
java.lang.String title,
java.lang.String author,
java.lang.String isbn)
Make new book record, not checked out, no due date yet. |
Method Summary | |
void |
addReservedBy(java.lang.String ptid)
Add one patron to reserve list for book |
static java.lang.String |
calendarToString(java.util.Calendar cal)
Convert Calendar object to string in legible format. |
void |
clearLoaned()
Set status of this book as no longer loaned out |
int |
compareTo(java.lang.Object bk2)
Compare two books, to implement Comparable interface. |
int |
countReservedBy()
Count how many reservations on this one book. |
java.lang.String |
getAuthor()
Accessor for author of book |
java.util.Calendar |
getDuedate()
Get date when this book is due |
java.lang.String |
getFirstReservedBy()
Get first patron who has reserved this book |
int |
getId()
Accessor for ID of book in library |
java.lang.String |
getIsbn()
Accessor for ISBN of book |
java.lang.String |
getLoanedTo()
Get patron who currently has this book checked out. |
java.util.Enumeration |
getReservedBy()
Make enumeration of reserved list for book. |
java.lang.String |
getTitle()
Accessor for title of book |
boolean |
isLoaned()
Is this book loaned out currently? |
void |
removeReservedBy(java.lang.String ptid)
Remove one patron from reserve list for book |
void |
setDuedate(java.util.Calendar dd)
Set date when this book is due |
void |
setLoaned(java.lang.String pid)
Set status of this book as loaned out to patron |
java.lang.String |
toString()
Make printable string, including legible date, describing the book. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long serialVersionUID
private java.lang.String title
private java.lang.String author
private java.lang.String isbn
private int bkid
private java.lang.String loanedTo
private java.util.Calendar duedate
private java.util.Vector reservedBy
Constructor Detail |
public Book2(int bkid, java.lang.String title, java.lang.String author, java.lang.String isbn)
bkid
- Library's ID number for booktitle
- Title of bookauthor
- Name of author of bookisbn
- Method Detail |
public int compareTo(java.lang.Object bk2)
bk2
- Second book, compared against this bookpublic int countReservedBy()
public java.util.Enumeration getReservedBy()
public java.lang.String getFirstReservedBy()
public void removeReservedBy(java.lang.String ptid)
ptid
- String card# of patron to be removedpublic void addReservedBy(java.lang.String ptid)
ptid
- String card# of patron to reserve this bookpublic java.lang.String getLoanedTo()
public boolean isLoaned()
public void setLoaned(java.lang.String pid)
pid
- String card# of patron who is checking out this book nowpublic void clearLoaned()
public java.util.Calendar getDuedate()
public void setDuedate(java.util.Calendar dd)
dd
- Calendar Date when this book is due to be returnedpublic java.lang.String getAuthor()
public java.lang.String getTitle()
public int getId()
public java.lang.String getIsbn()
public static java.lang.String calendarToString(java.util.Calendar cal)
cal
- Calendar object with some date&time contained within.public java.lang.String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |