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)
 Paper (String title, Long spiresId)
 Paper (String title, Integer spiresId)
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 ()
Paper setAuthors (SortedSet< String > authors)
Paper addAuthor (String author)
Paper removeAuthor (String 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.

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
 The Experiment(s) that made the measurements in this paper.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. Sort (type=org.hibernate.annotations.SortType.NATURAL)@org.hibernate.annotations.BatchSize(size
 Authors of the paper.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId (columns=@Column(name="PaperRefId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type
 References to this paper.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. IndexColumn (name="Posn")@Column(length
 Comments about this paper.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId (columns=@Column(name="PaperModId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type
 List of modifications.
.hibernate.annotations. Fetch (value=org.hibernate.annotations.FetchMode.SUBSELECT)@org.hibernate.annotations.Cascade(value
 The important bit --- the datasets!
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
Revision

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  ) 

Definition at line 91 of file Paper.java.

00091                                {
00092         setTitle(title);
00093     }

Paper ( String  title,
Long  spiresId 
)

Definition at line 95 of file Paper.java.

00095                                               {
00096         this(title);
00097         setSpiresId(spiresId);
00098     }

Paper ( String  title,
Integer  spiresId 
)

Definition at line 100 of file Paper.java.

00100                                                  {
00101         this(title, new Long(spiresId));
00102     }


Member Function Documentation

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

The Experiment(s) that made the measurements in this paper.

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

Authors of the paper.

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

References to this paper.

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

Comments about this paper.

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

List of modifications.

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

The important bit --- the datasets!

Long getSpiresId (  ) 

Get method for SPIRES ID.

Definition at line 109 of file Paper.java.

00109                               {
00110         return _spiresId;
00111     }

Paper setSpiresId ( Long  spiresId  ) 

Set method for SPIRES ID.

Definition at line 113 of file Paper.java.

00113                                             {
00114         _spiresId = spiresId;
00115         return this;
00116     }

Paper setSpiresId ( Integer  spiresId  ) 

Compatibility set method for SPIRES ID.

Definition at line 118 of file Paper.java.

00118                                                {
00119         _spiresId = new Long(spiresId);
00120         return this;
00121     }

Long getRedId (  ) 

Get method for reaction database ID.

Definition at line 125 of file Paper.java.

00125                            {
00126         return _redId;
00127     }

Paper setRedId ( Long  redId  ) 

Set method for reaction database ID.

Definition at line 129 of file Paper.java.

00129                                       {
00130         _redId = redId;
00131         return this;
00132     }

Paper setRedId ( Integer  redId  ) 

Compatibility set method for reaction database ID.

Definition at line 134 of file Paper.java.

00134                                          {
00135         _redId = new Long(redId);
00136         return this;
00137     }

String getTitle (  ) 

Get paper title.

Definition at line 142 of file Paper.java.

00142                              {
00143         return _title;
00144     }

Paper setTitle ( String  title  ) 

Set paper title.

Definition at line 146 of file Paper.java.

00146                                         {
00147         _title = title;
00148         return this;
00149     }

SortedSet<Experiment> getExperiments (  ) 

Get experiments.

Definition at line 154 of file Paper.java.

00154                                                   {
00155         return _experiments;
00156     }

Paper setExperiments ( SortedSet< Experiment experiments  ) 

Set experiments.

Definition at line 159 of file Paper.java.

00159                                                                    {
00160         _experiments = experiments;
00161         return this;
00162     }

Paper addExperiment ( Experiment  experiment  ) 

Add an experiment.

Definition at line 165 of file Paper.java.

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

Paper removeExperiment ( Experiment  experiment  ) 

Remove an experiment.

Definition at line 175 of file Paper.java.

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

SortedSet<String> getAuthors (  ) 

Definition at line 187 of file Paper.java.

00187                                           {
00188         return _authors;
00189     }

Paper setAuthors ( SortedSet< String >  authors  ) 

Definition at line 190 of file Paper.java.

00190                                                        {
00191         _authors = authors;
00192         return this;
00193     }

Paper addAuthor ( String  author  ) 

Definition at line 194 of file Paper.java.

Referenced by Data.makeExamplePaper().

00194                                           {
00195         if (author != null) {
00196             _authors.add(author);
00197         } else {
00198             log().warn("Tried to add a null author to a paper");
00199         }
00200         return this;
00201     }

Paper removeAuthor ( String  author  ) 

Definition at line 202 of file Paper.java.

00202                                              {
00203         if (author != null) {
00204             _authors.remove(author);
00205         } else {
00206             log().warn("Tried to remove a null author from a paper");
00207         }
00208         return this;
00209     }

List<String> getComments (  ) 

Get the comments.

Definition at line 213 of file Paper.java.

00213                                       {
00214         return _comments;
00215     }

Paper setComments ( List< String >  comments  ) 

Set the comments.

Definition at line 217 of file Paper.java.

00217                                                     {
00218         _comments = comments;
00219         return this;
00220     }

Paper addComment ( String  comment  ) 

Add a comment.

Definition at line 222 of file Paper.java.

00222                                             {
00223         _comments.add(comment);
00224         return this;
00225     }

SortedSet<Dataset> getDatasets (  ) 

Get datasets.

Definition at line 230 of file Paper.java.

Referenced by Dataset.setPaper().

00230                                             {
00231         return _datasets;
00232     }

Dataset getDataset ( Integer  datasetId  ) 

Get a specific dataset by dataset ID code.

Definition at line 235 of file Paper.java.

00235                                                  {
00236         Dataset theDataset = null;
00237         for (Dataset d : getDatasets()) {
00238             if (d.getId().equals(datasetId)) {
00239                 theDataset = d;
00240                 break;
00241             }
00242         }
00243         return theDataset;
00244     }

Paper setDatasets ( SortedSet< Dataset datasets  ) 

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

Todo:
Bidirectional?

Definition at line 247 of file Paper.java.

00247                                                           {
00249         _datasets = datasets;
00250         return this;
00251     }

Paper setDatasets ( Collection< Dataset datasets  ) 

Set datasets from a generic Collection.

Definition at line 254 of file Paper.java.

00254                                                            {
00255         setDatasets(new TreeSet(datasets));
00256         return this;
00257     }

Paper setDatasets ( Dataset[]  datasets  ) 

Set datasets from an array.

Definition at line 260 of file Paper.java.

00260                                                  {
00261         setDatasets(Arrays.asList(datasets));
00262         return this;
00263     }

Paper addDataset ( Dataset  dataset  ) 

Add a single dataset.

Definition at line 266 of file Paper.java.

References Dataset.getId(), Dataset.setId(), and Dataset.setPaper().

Referenced by Data.makeExample().

00266                                              {
00267         if (dataset != null) {
00268             if (dataset.getId() == null) {
00269                 int highestId = 0;
00270                 if (getDatasets().size() > 0) {
00271                     highestId = getDatasets().last().getId();
00272                 }
00273                 log().debug("Incrementing dataset ID: " + (highestId + 1));
00274                 dataset.setId(highestId + 1);
00275             }
00276             log().debug("Adding dataset: ID = " + dataset.getId());
00277             dataset.setPaper(this);
00278             _datasets.add(dataset);
00279         } else {
00280             log().warn("Tried to add null dataset to a paper");
00281         }
00282         return this;
00283     }

Paper removeDataset ( Dataset  dataset  ) 

Remove a dataset.

Definition at line 286 of file Paper.java.

References Dataset.setPaper().

00286                                                 {
00287         if (dataset != null) {
00288             dataset.setPaper(null); // Data orphaning
00289             _datasets.remove(dataset);
00290         } else {
00291             log().warn("Tried to remove a null dataset from a paper");
00292         }
00293         return this;
00294     }

SortedSet<Modification> getModifications (  ) 

Get the modifications.

Definition at line 298 of file Paper.java.

00298                                                       {
00299         return _modifications;
00300     }

Paper setModifications ( SortedSet< Modification modifications  ) 

Set the modifications.

Definition at line 303 of file Paper.java.

00303                                                                          {
00304         _modifications = modifications;
00305         return this;
00306     }

Paper addModification ( Modification  modification  ) 

Add a modification.

Definition at line 309 of file Paper.java.

00309                                                             {
00310         _modifications.add(modification);
00311         return this;
00312     }

Paper removeModification ( Modification  modification  ) 

Remove a modification.

Definition at line 315 of file Paper.java.

00315                                                                {
00316         _modifications.remove(modification);
00317         return this;
00318     }

SortedSet<Reference> getReferences (  ) 

Get the set of references to this paper.

Definition at line 323 of file Paper.java.

00323                                                 {
00324         return _references;
00325     }

Paper setReferences ( SortedSet< Reference references  ) 

Set the set of references to this paper.

Definition at line 328 of file Paper.java.

00328                                                                 {
00329         _references = references;
00330         return this;
00331     }

Paper addReference ( Reference  reference  ) 

Add a reference to this paper.

Definition at line 334 of file Paper.java.

00334                                                    {
00335         _references.add(reference);
00336         return this;
00337     }

Paper removeReference ( Reference  reference  ) 

Remove a reference.

Definition at line 340 of file Paper.java.

00340                                                       {
00341         _references.remove(reference);
00342         return this;
00343     }

String toString (  ) 

String representation.

Reimplemented from Storeable.

Definition at line 350 of file Paper.java.

00350                              {
00351         return toString(0);
00352     }

String toString ( Integer  indentBy  ) 

String representation with indent.

Definition at line 356 of file Paper.java.

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

Logger log (  )  [package, inherited]

Neat method to allow every class to get hold of a custom-named Logger.

Definition at line 14 of file Storeable.java.

Referenced by Uncertainty.compareTo(), Reference.compareTo(), PointError.compareTo(), Modification.compareTo(), Experiment.compareTo(), DatasetError.compareTo(), AxisError.compareTo(), Data.makeExample(), Data.makeExampleDataset(), Data.makeExampleExperiment(), Data.makeExamplePaper(), Data.makeExampleXAxes(), Data.makeExampleYAxes(), DatasetError.setNormType(), and Uncertainty.toString().

00014                  {
00015         return Logger.getLogger(this.getClass());
00016     }


The documentation for this class was generated from the following file:
Generated on Thu Sep 20 11:41:39 2007 by  doxygen 1.5.3