|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines the functions to represent a group of Authors. It should support various operations on a group of Authors like returning an iterator over the group, adding an Author to the group, testing whether an Author is a member of the group, retrieving random Authors, unioning with another AuthorGroup, etc.
A major constraint on the AuthorGroup is to include only Authors as its members.
Author| Method Summary | |
void |
addAuthor(Author author)
Adds an Author to the group |
boolean |
containsAuthor(Author author)
Tests whether the Group contains the Author or not |
java.util.Collection |
getAuthors()
Returns the Collection of Authors in the Group |
java.util.Iterator |
getIterator()
Returns the Iterator over the Group of Authors. |
Author |
getRandomAuthor()
Returns a random Author from the group |
void |
initialize(java.util.Collection collection)
Initializes the group of Authors with the specified Collection |
void |
removeAllAuthors()
Removes all the Author from the Group |
int |
size()
Returns the number of Authors in the Group |
| Method Detail |
public void initialize(java.util.Collection collection)
Authors with the specified Collection
collection - Specifies the collection of authorspublic java.util.Collection getAuthors()
Collection of Authors in the Group
public Author getRandomAuthor()
Author from the group
public java.util.Iterator getIterator()
Iterator over the Group of Authors. The Iterator should iterate only over the non-duplicate members of the AuthorGroup. The order of iteration does not matter as long as it covers all the non-duplicate members of the Group.
public int size()
Authors in the Group
public void addAuthor(Author author)
Author to the group
author - Specifies the author to be addedpublic void removeAllAuthors()
Author from the Group
public boolean containsAuthor(Author author)
Author or not
author - Specifies the author to be tested
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||