|
|||||||||||
| 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 Topics. It should support various operations on a group of Topics like returning an iterator over the group, adding a Topic to the group, testing whether a Topic is a member of the group, retrieving random Topic, etc.
A major constraint on the TopicGroup is to include only Topics as its members.
Topic| Method Summary | |
void |
addTopic(Topic topic)
Adds a Topic to the group |
boolean |
containsTopic(Topic topic)
Tests whether the Group contains the Topic or not |
java.util.Iterator |
getIterator()
Returns the Iterator over the Group of Topics. |
Topic |
getRandomTopic()
Returns a random Topic from the Group |
java.util.Collection |
getTopics()
Returns all the Topics in the group as a Collection |
void |
initialize(java.util.Collection collection)
Initializes the group of Topics with the specified Collection |
void |
removeAllTopics()
Removes all the Topic from the Group |
int |
size()
Returns the number of Topics in the Group |
| Method Detail |
public void initialize(java.util.Collection collection)
Topics with the specified Collection
collection - Specifies the collection of topicspublic java.util.Iterator getIterator()
Iterator over the Group of Topics. The Iterator should iterate only over the non-duplicate members of the TopicGroup. The order of iteration does not matter as long as it covers all the non-duplicate members of the Group.
public java.util.Collection getTopics()
Topics in the group as a Collection
public int size()
Topics in the Group
public void addTopic(Topic topic)
Topic to the group
topic - Specifies the topic to be addedpublic void removeAllTopics()
Topic from the Group
public boolean containsTopic(Topic topic)
Topic or not
topic - Specifies the topic to be tested
public Topic getRandomTopic()
Topic from the Group
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||