edu.iu.iv.modeling.tarl.topic
Interface TopicDatabase

All Known Implementing Classes:
DefaultTopicDatabase

public interface TopicDatabase

This interface defines the TopicDatabase which is used to store all the Topics ever produced in the system. The functions are responsible for actions like initializing the database, adding a new Topic to the database, iterating through each Topic of the database, removing all the Topics from the database, etc.
Apart from these functions, the major responsibility of the database is to tag each Topic with a unique identifier which distinguishes it from other Topics.

Author:
Jeegar T Maru
See Also:
TopicGroup, TopicManager

Method Summary
 void addTopic()
          Adds a new default Topic to the database.
 Topic getNextTopic()
          Returns the next Topic in the database while iteration
 TopicGroup getTopics()
          Returns all the Topics in the database
 boolean hasMoreTopics()
          Tests whether the database has more Topics for iteration
 void removeAll()
          Removes all the Topics from the database
 void resetSearchIndex()
          Resets the Search Index to the start of the list of Topics.
 int size()
          Returns the number of Topics in the database
 

Method Detail

addTopic

public void addTopic()
Adds a new default Topic to the database. The system should store the Topic for retreival in the future.


getTopics

public TopicGroup getTopics()
Returns all the Topics in the database

Returns:
the group of topics in the database

size

public int size()
Returns the number of Topics in the database

Returns:
the number of topics in the database

resetSearchIndex

public void resetSearchIndex()
Resets the Search Index to the start of the list of Topics. This function is called just before iterating through the Topics.


hasMoreTopics

public boolean hasMoreTopics()
Tests whether the database has more Topics for iteration

Returns:
true, if the database has more topics to visit

getNextTopic

public Topic getNextTopic()
                   throws java.util.NoSuchElementException
Returns the next Topic in the database while iteration

Returns:
the next topic in the database
Throws:
java.util.NoSuchElementException - if the database has no more topics

removeAll

public void removeAll()
Removes all the Topics from the database