|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.pavlov.library.Library
public final class Library
Describes a Library, which is a collection of Books.
Book,
Chapter,
Question| Constructor Summary | |
|---|---|
Library()
Creates an empty library. |
|
| Method Summary | |
|---|---|
void |
addBook(AbstractBook c)
Adds the book to the library , keyed on Book.getName(). |
void |
addBook(Book c)
Adds the book to the library , keyed on Book.getName(). |
void |
deleteBook(String bkName)
Removes the named book from this library. |
AbstractBook |
getBook(String bkName)
Returns the named book. |
Collection<AbstractBook> |
getBookCollection()
Deprecated. Use getBooks() |
Collection<AbstractBook> |
getBooks()
Returns all books as a Collection. |
Collection<AbstractBook> |
getBooksReadOnly()
Returns all books as a read-only Collection. |
Chapter |
getChapter(String bkName,
String cpName)
Returns the named Chapter from the named book. |
File |
getDirectory()
Describe getDirectory method here. |
void |
populateTree(DefaultMutableTreeNode top)
Displays books and chapters as a tree. |
void |
save()
Asks each book to save itself in its cannonical filename in my directory. |
void |
saveBook(Book b)
Saves the given book in its cannonical filename in my directory. |
void |
setDirectory(File dir)
Describe setDirectory method here. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Library()
| Method Detail |
|---|
public void setDirectory(File dir)
setDirectory method here.
dir - a File valuepublic File getDirectory()
getDirectory method here.
File value@Deprecated public Collection<AbstractBook> getBookCollection()
getBookCollection in interface AbstractLibraryCollection valuepublic Collection<AbstractBook> getBooksReadOnly()
getBooksReadOnly in interface AbstractLibraryCollection valuepublic Collection<AbstractBook> getBooks()
Collection valuepublic void addBook(Book c)
c - a Book valuepublic void addBook(AbstractBook c)
addBook in interface AbstractLibraryc - an AbstractBook value
public void save()
throws IOException
IOException
public void saveBook(Book b)
throws IOException
b - a Book value
IOExceptionpublic void populateTree(DefaultMutableTreeNode top)
populateTree in interface AbstractLibrarytop - a DefaultMutableTreeNode value
public Chapter getChapter(String bkName,
String cpName)
getChapter in interface AbstractLibrarybkName - a String valuecpName - a String value
Chapter valuepublic AbstractBook getBook(String bkName)
getBook in interface AbstractLibrarybkName - a String value
Book valuepublic void deleteBook(String bkName)
deleteBook in interface AbstractLibrarybkName - a String value
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||