|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Blab2
Blab2 (Second = 035B Java college-class, lab assignment #2) Set up a crude library system with only a few customers. Date started: 2004.Oct.04 for Lab#1, amended for Lab#2 from Oct.26
Constructor Summary | |
Blab2()
|
Method Summary | |
private static int |
askId(boolean newflg)
Ask user for book ID. |
private static boolean |
checkCommand(java.lang.String userstr,
java.lang.String cmdstr,
int minchars)
Compare user command string against correct command string for some particular command. |
private static void |
cmdAddNewBook()
Implements the Add new book command |
private static void |
cmdCheckOutBook(Patron pt)
Implements the Check out book command |
private static void |
cmdDelete()
Implements the Delete book command |
private static void |
cmdInfoListing(Patron pt)
For one patron, implementation of command to list all info about that patron. |
private static void |
cmdListAllBooks()
Implements the List all books command |
private static void |
cmdListOverdueBooks()
Implements the list Overdue books command |
private static void |
cmdNewPatron()
Implements command to add a new patron and assign library card. |
private static void |
cmdPatronLogin()
For commands related to a single patron, ask for card# then enter patron command loop. |
private static void |
cmdPayFine(Patron pt)
Allows patron to pay fine and thereby deduct amount owed |
private static void |
cmdRenewBook()
Implements the Renew book command |
private static void |
cmdReserveBook(Patron pt)
Implements patron command to reserve a book |
private static void |
cmdReturnBook()
Implements the Return book command |
private static void |
cmdSearchAuthor()
Implements command to search by author and print all info about all books found. |
private static void |
cmdSearchTitle()
Implements command to search by title and print all info about all books found. |
private static void |
cmdXpellPatron()
Implements command to eXpel (delete all info about) a patron, checking first to make sure no pending matters such as book still checked out or fine owed. |
private static void |
commandLoop()
Main command loop: Issues prompt, waits for user to type line of input, matches typed-command against available command, dispatches to appropriate command handler. |
static void |
main(java.lang.String[] args)
main method loads database, runs command loop, saves database on exit |
private static void |
printCommands()
Prints list of available user commands for main command loop |
private static void |
printPatronCommands()
Print list of commands in regard to one patron |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Blab2()
Method Detail |
public static void main(java.lang.String[] args) throws java.io.IOException, java.io.StreamCorruptedException, java.io.OptionalDataException, java.lang.ClassNotFoundException
args
- Not usedprivate static void cmdInfoListing(Patron pt)
pt
- Patron The full Patron recordprivate static void printPatronCommands()
private static void cmdDelete()
private static void cmdReturnBook()
private static void cmdRenewBook()
private static void cmdListOverdueBooks()
private static void cmdCheckOutBook(Patron pt)
private static void cmdListAllBooks()
private static void cmdAddNewBook()
private static int askId(boolean newflg)
newflg
- If true, user input accepted only if book is new, not
already in library. If false, user input accepted only if book is
old, already in library.private static boolean checkCommand(java.lang.String userstr, java.lang.String cmdstr, int minchars)
userstr
- String entered by user.cmdstr
- Full name of command to match.minchars
- Minimum length of user string allowed.private static void cmdPatronLogin()
private static void cmdPayFine(Patron pt)
pt
- Patron Full patron recordprivate static void cmdReserveBook(Patron pt)
pt
- Patron Full patron recordprivate static void cmdNewPatron()
private static void cmdXpellPatron()
private static void cmdSearchAuthor()
private static void cmdSearchTitle()
private static void commandLoop()
private static void printCommands()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |