edu.iu.iv.modeling.tarl.author
Interface AuthorGroup

All Known Implementing Classes:
DefaultAuthorGroup

public interface AuthorGroup

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:
Jeegar T Maru
See Also:
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

initialize

public void initialize(java.util.Collection collection)
Initializes the group of Authors with the specified Collection

Parameters:
collection - Specifies the collection of authors

getAuthors

public java.util.Collection getAuthors()
Returns the Collection of Authors in the Group

Returns:
the collection of authors in the group

getRandomAuthor

public Author getRandomAuthor()
Returns a random Author from the group

Returns:
a random author from the group

getIterator

public java.util.Iterator getIterator()
Returns the 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.

Returns:
the iterator over the group of authors

size

public int size()
Returns the number of Authors in the Group

Returns:
the number of authors in the group

addAuthor

public void addAuthor(Author author)
Adds an Author to the group

Parameters:
author - Specifies the author to be added

removeAllAuthors

public void removeAllAuthors()
Removes all the Author from the Group


containsAuthor

public boolean containsAuthor(Author author)
Tests whether the Group contains the Author or not

Parameters:
author - Specifies the author to be tested
Returns:
true, if the author is contained in the group