|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 AbstractLibrary
Collection
valuepublic Collection<AbstractBook> getBooksReadOnly()
getBooksReadOnly
in interface AbstractLibrary
Collection
valuepublic Collection<AbstractBook> getBooks()
Collection
valuepublic void addBook(Book c)
c
- a Book
valuepublic void addBook(AbstractBook c)
addBook
in interface AbstractLibrary
c
- an AbstractBook
valuepublic void save() throws IOException
IOException
public void saveBook(Book b) throws IOException
b
- a Book
value
IOException
public void populateTree(DefaultMutableTreeNode top)
populateTree
in interface AbstractLibrary
top
- a DefaultMutableTreeNode
valuepublic Chapter getChapter(String bkName, String cpName)
getChapter
in interface AbstractLibrary
bkName
- a String
valuecpName
- a String
value
Chapter
valuepublic AbstractBook getBook(String bkName)
getBook
in interface AbstractLibrary
bkName
- a String
value
Book
valuepublic void deleteBook(String bkName)
deleteBook
in interface AbstractLibrary
bkName
- a String
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |