edu.iu.iv.modeling.tarl.publication.impl
Class DefaultPublication

java.lang.Object
  |
  +--edu.iu.iv.modeling.tarl.publication.impl.DefaultPublication
All Implemented Interfaces:
Publication

public class DefaultPublication
extends java.lang.Object
implements Publication

This class defines a default implementation of a PublicationInterface. Publications are represented by the following attributes :

Author:
Jeegar T Maru
See Also:
DefaultTopic, DefaultAuthorGroup, DefaultPublicationGroup, Publication

Constructor Summary
DefaultPublication()
          Creates a new instance of a default Publication
DefaultPublication(int id, int year, Topic topic, AuthorGroup authors)
          Creates a new instance for an Publication with the specified id and Topic.
DefaultPublication(int id, int year, Topic topic, AuthorGroup authors, PublicationGroup citations)
          Creates a new instance for a Publication with the specified id, Topic, authors and citations
 
Method Summary
 void addCitation(Publication citation)
          Adds a Citation to the group of citations of the Publication
 boolean equals(Publication publication)
          Tests whether the current Publication is the same as the Publication given by the parameter
 AuthorGroup getAuthors()
          Returns the Authors of the Publication
 PublicationGroup getCitations()
          Returns the Citations of the Publication
 int getId()
          Returns the id of the Publication
 Topic getTopic()
          Returns the Topic of the Publication
 int getYear()
          Returns the year of Publication
 void initialize(int id, int year, Topic topic, AuthorGroup authors)
          Initializes an instance of a Publication with the specified id, Topic and the group of Authors
 void initialize(int id, int year, Topic topic, AuthorGroup authors, PublicationGroup citations)
          Initializes an instance of a Publication with the specified id, Topic, the group of Authors and the group of Publications
 java.lang.String toString()
          Returns the details of the Publication as a String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultPublication

public DefaultPublication()
Creates a new instance of a default Publication


DefaultPublication

public DefaultPublication(int id,
                          int year,
                          Topic topic,
                          AuthorGroup authors)
                   throws TarlException
Creates a new instance for an Publication with the specified id and Topic. A Publication should have an id, a year of publication, a Topic and a set of authors at the very least.

Parameters:
id - Specifies the unique id for the newly instantiated Publication
topic - Specifies the topic for the newly instantiated Publication
authors - Specifies the authors who have contributed for the newly instantiated Publication
Throws:
TarlException - if topic or authors are not specified

DefaultPublication

public DefaultPublication(int id,
                          int year,
                          Topic topic,
                          AuthorGroup authors,
                          PublicationGroup citations)
                   throws TarlException
Creates a new instance for a Publication with the specified id, Topic, authors and citations

Parameters:
id - Specifies the unique id for the newly instantiated Publication
topic - Specifies the topic for the newly instantiated Publication
authors - Specifies the authors who have contributed for the newly instantiated Publication
citations - Specifies the citations for the the newly instantiated Publication
Throws:
TarlException - if there are no topics or authors specified
Method Detail

initialize

public void initialize(int id,
                       int year,
                       Topic topic,
                       AuthorGroup authors)
                throws TarlException
Initializes an instance of a Publication with the specified id, Topic and the group of Authors

Specified by:
initialize in interface Publication
Parameters:
id - Specifies the unique identifier for the publication
topic - Specifies the topic for the publication
authors - Specifies the authors who have contributed for the publication
year - Specifies the year of publication
Throws:
TarlException - if topic or authors are not specified

initialize

public void initialize(int id,
                       int year,
                       Topic topic,
                       AuthorGroup authors,
                       PublicationGroup citations)
                throws TarlException
Initializes an instance of a Publication with the specified id, Topic, the group of Authors and the group of Publications

Specified by:
initialize in interface Publication
Parameters:
id - Specifies the unique id for the newly instantiated Publication
topic - Specifies the topic for the newly instantiated Publication
authors - Specifies the authors who have contributed for the newly instantiated Publication
citations - Specifies the citations for the the newly instantiated Publication
year - Specifies the year of publication
Throws:
TarlException - if there are no topics or authors specified

getId

public int getId()
Returns the id of the Publication

Specified by:
getId in interface Publication
Returns:
the id of the publication as an integer

getYear

public int getYear()
Returns the year of Publication

Specified by:
getYear in interface Publication
Returns:
the year of publication as an integer

getTopic

public Topic getTopic()
Returns the Topic of the Publication

Specified by:
getTopic in interface Publication
Returns:
the topic of the publication

getAuthors

public AuthorGroup getAuthors()
Returns the Authors of the Publication

Specified by:
getAuthors in interface Publication
Returns:
the authors who have collaborated for the publication, as an authorset

getCitations

public PublicationGroup getCitations()
Returns the Citations of the Publication

Specified by:
getCitations in interface Publication
Returns:
the citations of the publication, as a publicationset

addCitation

public void addCitation(Publication citation)
Adds a Citation to the group of citations of the Publication

Parameters:
citation - Specifies the citation to be added to the group

equals

public boolean equals(Publication publication)
Tests whether the current Publication is the same as the Publication given by the parameter

Specified by:
equals in interface Publication
Parameters:
publication - Specifies the publication to be equated against
Returns:
true if the current publication and the specified publication are equal

toString

public java.lang.String toString()
Returns the details of the Publication as a String

Overrides:
toString in class java.lang.Object
Returns:
a String describing the publication