Paper Class Reference

A published document containing one or many Datasets. More...

Inheritance diagram for Paper:

Inheritance graph
[legend]

Collaboration diagram for Paper:

Collaboration graph
[legend]

List of all members.


Public Member Functions

 Paper ()
 No-arg constructor for Hibernate.
 Paper (String title)
 Constructor taking a title string.
 Paper (String title, Long spiresId)
 Constructor taking a title string and Spires ID (IRN).
 Paper (String title, Integer spiresId)
 Constructor taking a title string and Spires ID (IRN).
Long getSpiresId ()
 Get method for SPIRES ID.
Paper setSpiresId (Long spiresId)
 Set method for SPIRES ID.
Paper setSpiresId (Integer spiresId)
 Compatibility set method for SPIRES ID.
Long getRedId ()
 Get method for reaction database ID.
Paper setRedId (Long redId)
 Set method for reaction database ID.
Paper setRedId (Integer redId)
 Compatibility set method for reaction database ID.
String getTitle ()
 Get paper title.
Paper setTitle (String title)
 Set paper title.
SortedSet< ExperimentgetExperiments ()
 Get experiments.
Paper setExperiments (SortedSet< Experiment > experiments)
 Set experiments.
Paper addExperiment (Experiment experiment)
 Add an experiment.
Paper removeExperiment (Experiment experiment)
 Remove an experiment.
SortedSet< String > getAuthors ()
 Get the authors.
Paper setAuthors (SortedSet< String > authors)
 Set the authors.
Paper addAuthor (String author)
 Add an author.
Paper removeAuthor (String author)
 Remove an author.
List< String > getComments ()
 Get the comments.
Paper setComments (List< String > comments)
 Set the comments.
Paper addComment (String comment)
 Add a comment.
SortedSet< DatasetgetDatasets ()
 Get datasets.
Dataset getDataset (Integer datasetId)
 Get a specific dataset by dataset ID code.
Paper setDatasets (SortedSet< Dataset > datasets)
 Set datasets explicitly from a SortedSet, to keep reflection apps happy.
Paper setDatasets (Collection< Dataset > datasets)
 Set datasets from a generic Collection.
Paper setDatasets (Dataset[] datasets)
 Set datasets from an array.
Paper addDataset (Dataset dataset)
 Add a single dataset.
Paper removeDataset (Dataset dataset)
 Remove a dataset.
SortedSet< ModificationgetModifications ()
 Get the modifications.
Paper setModifications (SortedSet< Modification > modifications)
 Set the modifications.
Paper addModification (Modification modification)
 Add a modification.
Paper removeModification (Modification modification)
 Remove a modification.
SortedSet< ReferencegetReferences ()
 Get the set of references to this paper.
Paper setReferences (SortedSet< Reference > references)
 Set the set of references to this paper.
Paper addReference (Reference reference)
 Add a reference to this paper.
Paper removeReference (Reference reference)
 Remove a reference.
String toString ()
 String representation.
String toString (Integer indentBy)
 String representation with indent.
boolean equals (Object other)
 Overridden equals comparison.
int hashCode ()
 Overridden hashCode.

Package Functions

.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId (columns=@Column(name="PaperExptId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type
.hibernate.annotations.CollectionOfElements.hibernate.annotations. Sort (type=org.hibernate.annotations.SortType.NATURAL)@org.hibernate.annotations.BatchSize(size
.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId (columns=@Column(name="PaperRefId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type
.hibernate.annotations.CollectionOfElements.hibernate.annotations. IndexColumn (name="Posn")@Column(length
.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId (columns=@Column(name="PaperModId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type
.hibernate.annotations. Fetch (value=org.hibernate.annotations.FetchMode.SUBSELECT)@org.hibernate.annotations.Cascade(value
Logger log ()
 Neat method to allow every class to get hold of a custom-named Logger.

Detailed Description

A published document containing one or many Datasets.

Author:
Andy Buckley
Version:
Date
2007-09-25 13:26:25 +0100 (Tue, 25 Sep 2007)
Revision
1075

Definition at line 13 of file Paper.java.


Constructor & Destructor Documentation

Paper (  ) 

No-arg constructor for Hibernate.

Definition at line 89 of file Paper.java.

00089 {}

Paper ( String  title  ) 

Constructor taking a title string.

Definition at line 92 of file Paper.java.

00092                                {
00093         setTitle(title);
00094     }

Paper ( String  title,
Long  spiresId 
)

Constructor taking a title string and Spires ID (IRN).

Definition at line 97 of file Paper.java.

00097                                               {
00098         this(title);
00099         setSpiresId(spiresId);
00100     }

Paper ( String  title,
Integer  spiresId 
)

Constructor taking a title string and Spires ID (IRN).

Definition at line 103 of file Paper.java.

00103                                                  {
00104         this(title, new Long(spiresId));
00105     }


Member Function Documentation

.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId ( columns  = @Column(name="PaperExptId"),
type  = @org.hibernate.annotations.Type(type="long"),
generator  = "sequence" 
) [package]

.hibernate.annotations.CollectionOfElements.hibernate.annotations. Sort ( type  = org.hibernate.annotations.SortType.NATURAL  )  [package]

.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId ( columns  = @Column(name="PaperRefId"),
type  = @org.hibernate.annotations.Type(type="long"),
generator  = "sequence" 
) [package]

.hibernate.annotations.CollectionOfElements.hibernate.annotations. IndexColumn ( name  = "Posn"  )  [package]

.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId ( columns  = @Column(name="PaperModId"),
type  = @org.hibernate.annotations.Type(type="long"),
generator  = "sequence" 
) [package]

.hibernate.annotations. Fetch ( value  = org.hibernate.annotations.FetchMode.SUBSELECT  )  [package]

Long getSpiresId (  ) 

Get method for SPIRES ID.

Definition at line 112 of file Paper.java.

00112                               {
00113         return _spiresId;
00114     }

Paper setSpiresId ( Long  spiresId  ) 

Set method for SPIRES ID.

Definition at line 116 of file Paper.java.

00116                                             {
00117         _spiresId = spiresId;
00118         return this;
00119     }

Paper setSpiresId ( Integer  spiresId  ) 

Compatibility set method for SPIRES ID.

Definition at line 121 of file Paper.java.

00121                                                {
00122         _spiresId = new Long(spiresId);
00123         return this;
00124     }

Long getRedId (  ) 

Get method for reaction database ID.

Definition at line 128 of file Paper.java.

00128                            {
00129         return _redId;
00130     }

Paper setRedId ( Long  redId  ) 

Set method for reaction database ID.

Definition at line 132 of file Paper.java.

00132                                       {
00133         _redId = redId;
00134         return this;
00135     }

Paper setRedId ( Integer  redId  ) 

Compatibility set method for reaction database ID.

Definition at line 137 of file Paper.java.

00137                                          {
00138         _redId = new Long(redId);
00139         return this;
00140     }

String getTitle (  ) 

Get paper title.

Definition at line 145 of file Paper.java.

00145                              {
00146         return _title;
00147     }

Paper setTitle ( String  title  ) 

Set paper title.

Definition at line 149 of file Paper.java.

00149                                         {
00150         _title = title;
00151         return this;
00152     }

SortedSet<Experiment> getExperiments (  ) 

Get experiments.

Definition at line 157 of file Paper.java.

00157                                                   {
00158         return _experiments;
00159     }

Paper setExperiments ( SortedSet< Experiment experiments  ) 

Set experiments.

Definition at line 162 of file Paper.java.

00162                                                                    {
00163         _experiments = experiments;
00164         return this;
00165     }

Paper addExperiment ( Experiment  experiment  ) 

Add an experiment.

Definition at line 168 of file Paper.java.

00168                                                       {
00169         if (experiment != null) {
00170             _experiments.add(experiment);
00171         } else {
00172             log().warn("Tried to add a null experiment to a paper");
00173         }
00174         return this;
00175     }

Paper removeExperiment ( Experiment  experiment  ) 

Remove an experiment.

Definition at line 178 of file Paper.java.

00178                                                          {
00179         if (experiment != null) {
00180             _experiments.remove(experiment);
00181         } else {
00182             log().warn("Tried to remove a null experiment from a paper");
00183         }
00184         return this;
00185     }

SortedSet<String> getAuthors (  ) 

Get the authors.

Definition at line 190 of file Paper.java.

00190                                           {
00191         return _authors;
00192     }

Paper setAuthors ( SortedSet< String >  authors  ) 

Set the authors.

Definition at line 194 of file Paper.java.

00194                                                        {
00195         _authors = authors;
00196         return this;
00197     }

Paper addAuthor ( String  author  ) 

Add an author.

Definition at line 199 of file Paper.java.

Referenced by Data.makeExamplePaper().

00199                                           {
00200         if (author != null) {
00201             _authors.add(author);
00202         } else {
00203             log().warn("Tried to add a null author to a paper");
00204         }
00205         return this;
00206     }

Paper removeAuthor ( String  author  ) 

Remove an author.

Definition at line 208 of file Paper.java.

00208                                              {
00209         if (author != null) {
00210             _authors.remove(author);
00211         } else {
00212             log().warn("Tried to remove a null author from a paper");
00213         }
00214         return this;
00215     }

List<String> getComments (  ) 

Get the comments.

Definition at line 219 of file Paper.java.

00219                                       {
00220         return _comments;
00221     }

Paper setComments ( List< String >  comments  ) 

Set the comments.

Definition at line 223 of file Paper.java.

00223                                                     {
00224         _comments = comments;
00225         return this;
00226     }

Paper addComment ( String  comment  ) 

Add a comment.

Definition at line 228 of file Paper.java.

00228                                             {
00229         _comments.add(comment);
00230         return this;
00231     }

SortedSet<Dataset> getDatasets (  ) 

Get datasets.

Definition at line 236 of file Paper.java.

Referenced by Dataset.setPaper().

00236                                             {
00237         return _datasets;
00238     }

Dataset getDataset ( Integer  datasetId  ) 

Get a specific dataset by dataset ID code.

Definition at line 241 of file Paper.java.

00241                                                  {
00242         Dataset theDataset = null;
00243         for (Dataset d : getDatasets()) {
00244             if (d.getId().equals(datasetId)) {
00245                 theDataset = d;
00246                 break;
00247             }
00248         }
00249         return theDataset;
00250     }

Paper setDatasets ( SortedSet< Dataset datasets  ) 

Set datasets explicitly from a SortedSet, to keep reflection apps happy.

Definition at line 253 of file Paper.java.

00253                                                           {
00254         getDatasets().clear();
00255         for (Dataset d : datasets) addDataset(d);
00256         return this;
00257     }

Paper setDatasets ( Collection< Dataset datasets  ) 

Set datasets from a generic Collection.

Definition at line 260 of file Paper.java.

00260                                                            {
00261         setDatasets(new TreeSet(datasets));
00262         return this;
00263     }

Paper setDatasets ( Dataset[]  datasets  ) 

Set datasets from an array.

Definition at line 266 of file Paper.java.

00266                                                  {
00267         setDatasets(Arrays.asList(datasets));
00268         return this;
00269     }

Paper addDataset ( Dataset  dataset  ) 

Add a single dataset.

Definition at line 272 of file Paper.java.

References Dataset.setPaper().

Referenced by Data.makeExample().

00272                                              {
00273         if (dataset != null) {
00274             dataset.setPaper(this);
00275         } else {
00276             log().warn("Tried to add null dataset to a paper");
00277         }
00278         return this;
00279     }

Paper removeDataset ( Dataset  dataset  ) 

Remove a dataset.

Definition at line 282 of file Paper.java.

00282                                                 {
00283         if (dataset != null) {
00284             _datasets.remove(dataset);
00285         } else {
00286             log().warn("Tried to remove a null dataset from a paper");
00287         }
00288         return this;
00289     }

SortedSet<Modification> getModifications (  ) 

Get the modifications.

Definition at line 293 of file Paper.java.

00293                                                       {
00294         return _modifications;
00295     }

Paper setModifications ( SortedSet< Modification modifications  ) 

Set the modifications.

Definition at line 298 of file Paper.java.

00298                                                                          {
00299         _modifications = modifications;
00300         return this;
00301     }

Paper addModification ( Modification  modification  ) 

Add a modification.

Definition at line 304 of file Paper.java.

00304                                                             {
00305         _modifications.add(modification);
00306         return this;
00307     }

Paper removeModification ( Modification  modification  ) 

Remove a modification.

Definition at line 310 of file Paper.java.

00310                                                                {
00311         _modifications.remove(modification);
00312         return this;
00313     }

SortedSet<Reference> getReferences (  ) 

Get the set of references to this paper.

Definition at line 318 of file Paper.java.

00318                                                 {
00319         return _references;
00320     }

Paper setReferences ( SortedSet< Reference references  ) 

Set the set of references to this paper.

Definition at line 323 of file Paper.java.

00323                                                                 {
00324         _references = references;
00325         return this;
00326     }

Paper addReference ( Reference  reference  ) 

Add a reference to this paper.

Definition at line 329 of file Paper.java.

00329                                                    {
00330         _references.add(reference);
00331         return this;
00332     }

Paper removeReference ( Reference  reference  ) 

Remove a reference.

Definition at line 335 of file Paper.java.

00335                                                       {
00336         _references.remove(reference);
00337         return this;
00338     }

String toString (  ) 

String representation.

Reimplemented from Storeable.

Definition at line 345 of file Paper.java.

00345                              {
00346         return toString(0);
00347     }

String toString ( Integer  indentBy  ) 

String representation with indent.

Definition at line 351 of file Paper.java.

00351                                              {
00352         StringBuffer s = new StringBuffer();
00353         String indent = "";
00354         for (int i  = 0; i < indentBy; ++i) indent += " ";
00355 
00356         // Title
00357         s.append(indent + "Title: ");
00358         if (getTitle() != null) {
00359             s.append(getTitle());
00360         } else {
00361             s.append("N/A");
00362         }
00363 
00364         // ID codes
00365         s.append("\n" + indent + "Spires ID: " + getSpiresId());
00366         if (getRedId() != null) {
00367             s.append("\n" + indent + "Reaction database ID: " + getRedId());
00368         }
00369 
00370         // Modifications
00371         s.append("\n" + indent + "Modifications: ");
00372         if (getModifications().size() == 0) {
00373             s.append("none");
00374         } else {
00375             for (Modification mod : getModifications()) {
00376                 s.append("\n" + indent + mod.getTimestamp());
00377                 s.append(" by " + mod.getModifier());
00378                 if (mod.getComment() != null && mod.getComment().length() != 0)
00379                     s.append(": " + mod.getComment());
00380             }
00381         }
00382 
00383         // Comments
00384         s.append("\n" + indent + "Comments: ");
00385         if (getComments().size() == 0) {
00386             s.append("none");
00387         } else {
00388             for (String c : getComments()) s.append("\n" + c);
00389         }
00390 
00391         // Dataset (recursive toString)
00392         if (!getDatasets().isEmpty()) {
00393             s.append("\n" + indent + getDatasets().size() + " Datasets");
00394             for (Dataset ds : getDatasets()) {
00395                 s.append("\n" + ds.toString(indentBy + 2));
00396             }
00397         }
00398 
00399         return s.toString();
00400     }

boolean equals ( Object  other  ) 

Overridden equals comparison.

Definition at line 407 of file Paper.java.

00407                                         {
00408         if (this == other) return true;
00409         if (! (other instanceof Paper)) return false;
00410         return hashCode() == other.hashCode();
00411     }

int hashCode (  ) 

Overridden hashCode.

Definition at line 414 of file Paper.java.

00414                           {
00415         int code = 37;
00416         if (getSpiresId() != null) code ^= getSpiresId().hashCode();
00417         if (getRedId() != null)    code ^= getRedId().hashCode();
00418         if (getTitle() != null)    code ^= getTitle().hashCode();
00419         for (Experiment e : getExperiments())     code ^= e.hashCode();
00420         for (String a : getAuthors())             code ^= a.hashCode();
00421         for (String c : getComments())            code ^= c.hashCode();
00422         for (Modification m : getModifications()) code ^= m.hashCode();
00423         for (Reference r : getReferences())       code ^= r.hashCode();
00424         return code;
00425     }

Logger log (  )  [package, inherited]


The documentation for this class was generated from the following file:


Generated on Tue Apr 21 15:54:47 2009 for HepData object model by  doxygen 1.5.5