|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines the AuthorDatabase which is used to store all the Authors ever produced in the system. The interface is responsible for operations like initializing the database, adding a new Author to the database, iterating through each Author of the database, removing all the Authors from the database, etc.
Apart from these functions, the major responsibility of the interface is to tag each Author with a unique identifier which distinguishes it from other Authors.
AuthorGroup,
AuthorManager| Method Summary | |
void |
addAuthor(Topic topic)
Adds a new Author to the database with the specified Topic. |
void |
addAuthor(Topic topic,
int maximumAge)
Adds a new Author to the database with the specified Topic and maximum age. |
AuthorGroup |
getAuthors()
Returns all the Authors in the database |
Author |
getNextAuthor()
Returns the next Author in the database while iteration |
boolean |
hasMoreAuthors()
Tests whether the database has more Authors for iteration |
void |
removeAll()
Removes all the Authors from the database |
void |
resetSearchIndex()
Resets the Search Index to the start of the list of Authors. |
int |
size()
Returns the number of Authors in the database |
| Method Detail |
public void addAuthor(Topic topic)
throws TarlException
Author to the database with the specified Topic. The system should store the Author for retreival in the future. The maximum age of the author is assumed to be infinite.
topic - Specifies the topic that the author belongs to
TarlException - if the specified parameters are insufficient to construct an author
public void addAuthor(Topic topic,
int maximumAge)
throws TarlException
Author to the database with the specified Topic and maximum age. The system should store the Author for retreival in the future.
topic - Specifies the topic that the author belongs tomaximumAge - Specifies the maximum age of the author
TarlException - if the specified parameters are insufficient to construct an authorpublic AuthorGroup getAuthors()
Authors in the database
public int size()
Authors in the database
public void resetSearchIndex()
Authors. This function is called just before iterating through the Authors.
public boolean hasMoreAuthors()
Authors for iteration
public Author getNextAuthor()
throws java.util.NoSuchElementException
Author in the database while iteration
java.util.NoSuchElementException - if the database has no more authorspublic void removeAll()
Authors from the database
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||