edu.iu.iv.modeling.tarl.publication
Interface PublicationDatabase

All Known Implementing Classes:
DefaultPublicationDatabase

public interface PublicationDatabase

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

Author:
Jeegar T Maru
See Also:
PublicationGroup, PublicationManager

Method Summary
 void addPublication(int year, Topic topic, AuthorGroup authors)
          Adds a new Publication to the database with the specified year of publication, Topic and the group of Authors.
 void addPublication(int year, Topic topic, AuthorGroup authors, PublicationGroup citations)
          Adds a new Publication to the database with the specified year of publication, Topic and the group of Authors and the group of Publications.
 Publication getNextPublication()
          Returns the next Publication in the database while iteration
 PublicationGroup getPublications()
          Returns all the Publications in the database
 boolean hasMorePublications()
          Tests whether the database has more Publications for iteration
 void removeAll()
          Removes all the Publications from the database
 void resetSearchIndex()
          Resets the Search Index to the start of the list of Publications.
 int size()
          Returns the number of Publications in the database
 

Method Detail

addPublication

public void addPublication(int year,
                           Topic topic,
                           AuthorGroup authors)
                    throws TarlException
Adds a new Publication to the database with the specified year of publication, Topic and the group of Authors. The system should store the Publication for retreival in the future. It is assumed that the Publication has no citations at all.

Parameters:
year - Specifies the year of publication
topic - Specifies the topic that the publication belongs to
authors - Specifies the group of authors who have collaborated for the publication
Throws:
TarlException - if the specified parameters are insufficient to construct a publication

addPublication

public void addPublication(int year,
                           Topic topic,
                           AuthorGroup authors,
                           PublicationGroup citations)
                    throws TarlException
Adds a new Publication to the database with the specified year of publication, Topic and the group of Authors and the group of Publications. The system should store the Publication for retreival in the future.

Parameters:
year - Specifies the year of publication
topic - Specifies the topic that the publication belongs to
authors - Specifies the group of authors who have collaborated for the publication
citations - Specifies the group of citations for the publication
Throws:
TarlException - if the specified parameters are insufficient to construct a publication

getPublications

public PublicationGroup getPublications()
Returns all the Publications in the database

Returns:
the group of publications in the database

size

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

Returns:
the number of publications in the database

resetSearchIndex

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


hasMorePublications

public boolean hasMorePublications()
Tests whether the database has more Publications for iteration

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

getNextPublication

public Publication getNextPublication()
                               throws java.util.NoSuchElementException
Returns the next Publication in the database while iteration

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

removeAll

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