|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.norvelle.textcite.model.BookCollection
public class BookCollection
The BookCollection object maintains a sorted list of all the Books currently in the Citebook.
Nested Class Summary | |
---|---|
static class |
BookCollection.BookCollectionConverter
BookCollectionConverter is an inner class used for serializing BookCollection objects via XStream. |
Field Summary | |
---|---|
java.util.HashMap<java.lang.Integer,Book> |
books
We use a HashMap here to maintain a reference to all Books by their IDs |
Constructor Summary | |
---|---|
BookCollection()
The constructor. |
Method Summary | |
---|---|
void |
addAdapter(ListModelChangeListener adapter)
|
void |
checkBookIntegrity()
Make sure that all Books in the collection are connected to Authors which know about the books. |
void |
clear()
|
Book |
getBookByName(java.lang.String name)
|
java.lang.Object |
getElementAt(int pos)
Returns the Book at the given position in the sorted list. |
int |
getObjectCount()
|
int |
getPosInList(java.lang.Object item)
|
int |
getSize()
|
boolean |
isBookInList(java.lang.String name)
If the book already exists in the list (with the same author) return tru |
void |
recreateAdapterCollection()
After loading a new file, the AdapterCollection (which is marked as transient) will not be recreated during the deserialization process. |
void |
registerBook(Book book)
Add a Book object to the list. |
void |
removeAdapter(ListModelChangeListener adapter)
|
void |
restoreCitationReferences()
After deserializing the Books, each Book object needs to rebuild its HashMap of references to the Citations registered for the author. |
void |
unregisterBook(Book book)
Eliminate the given Book object from the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.HashMap<java.lang.Integer,Book> books
Constructor Detail |
---|
public BookCollection()
Method Detail |
---|
public void registerBook(Book book) throws DuplicateRecordException
book
- The Book object to be added
DuplicateRecordException
public void unregisterBook(Book book)
book
- The Book object to be removed from the list.public java.lang.Object getElementAt(int pos)
getElementAt
in interface ListModelAdaptee
ListModel.getElementAt(int)
public int getSize()
getSize
in interface ListModelAdaptee
public int getObjectCount()
public void clear()
public boolean isBookInList(java.lang.String name)
name
- The name of the book to search forpublic Book getBookByName(java.lang.String name)
public int getPosInList(java.lang.Object item)
getPosInList
in interface ListModelAdaptee
public void addAdapter(ListModelChangeListener adapter)
addAdapter
in interface ListModelAdaptee
public void removeAdapter(ListModelChangeListener adapter)
removeAdapter
in interface ListModelAdaptee
public void recreateAdapterCollection()
recreateAdapterCollection
in interface ListModelAdaptee
public void restoreCitationReferences()
public void checkBookIntegrity()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |