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< Experiment > | getExperiments () |
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< Dataset > | getDatasets () |
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< Modification > | getModifications () |
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< Reference > | getReferences () |
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. |
Definition at line 13 of file Paper.java.
Paper | ( | ) |
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 | |||
) |
.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 | ( | ) |
Paper setSpiresId | ( | Long | spiresId | ) |
Paper setSpiresId | ( | Integer | spiresId | ) |
Long getRedId | ( | ) |
Paper setRedId | ( | Long | redId | ) |
Paper setRedId | ( | Integer | redId | ) |
String getTitle | ( | ) |
Paper setTitle | ( | String | title | ) |
SortedSet<Experiment> getExperiments | ( | ) |
Paper setExperiments | ( | SortedSet< Experiment > | experiments | ) |
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 | ( | ) |
Paper setAuthors | ( | SortedSet< String > | authors | ) |
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 | ( | ) |
Paper setComments | ( | List< String > | comments | ) |
Paper addComment | ( | String | comment | ) |
SortedSet<Dataset> getDatasets | ( | ) |
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 }
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 }
Set datasets from a generic Collection.
Definition at line 260 of file Paper.java.
00260 { 00261 setDatasets(new TreeSet(datasets)); 00262 return this; 00263 }
Set datasets from an array.
Definition at line 266 of file Paper.java.
00266 { 00267 setDatasets(Arrays.asList(datasets)); 00268 return this; 00269 }
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 }
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 | ( | ) |
Paper setModifications | ( | SortedSet< Modification > | modifications | ) |
Paper addModification | ( | Modification | modification | ) |
Paper removeModification | ( | Modification | modification | ) |
SortedSet<Reference> getReferences | ( | ) |
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] |
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(), AxisError.setAxis(), DatasetError.setDataset(), DatasetError.setNormType(), PointError.setPoint(), and Uncertainty.toString().