Public Member Functions | |
YAxis () | |
No-arg constructor. | |
YAxis (Dataset dataset) | |
YAxis (String header, String observable, Unit unit) | |
YAxis (Dataset dataset, String header, String observable, Unit unit) | |
Paper | getPaper () |
Get the Paper that this axis belongs to. | |
List< String > | getComments () |
YAxis | setComments (List< String > comments) |
YAxis | addComment (String comment) |
YAxis | removeComment (String comment) |
Integer | getId () |
Get y-axis ID code. | |
YAxis | setId (Integer yAxisId) |
Set y-axis ID code. | |
Dataset | getDataset () |
Get the Dataset that this axis belongs to. | |
YAxis | setDataset (Dataset dataset) |
Over-ride dataset assignment, to get null IDs right. | |
SortedSet< XAxis > | getXAxes () |
Get associated x-axes. | |
Set< AxisReaction > | getReactions () |
Get reactions. | |
YAxis | setReactions (Set< AxisReaction > reactions) |
Set reactions. | |
YAxis | addReaction (AxisReaction reaction) |
Add a reaction. | |
YAxis | removeReaction (AxisReaction reaction) |
Remove a reaction. | |
String | getObservable () |
Get observable. | |
YAxis | setObservable (String observable) |
Set observable. | |
SortedSet< Point > | getPoints () |
Get points. | |
Point | getPoint (Integer pointId) |
Get a specific point from this axis by point ID code. | |
YAxis | setPoints (SortedSet< Point > points) |
Explicit set-points-from-SortedSet to keep reflection apps happy. | |
YAxis | setPoints (Collection< Point > points) |
Set points from a Collection. | |
YAxis | setPoints (Point[] points) |
Set points from an array. | |
YAxis | addPoint (Point point) |
Add a point. | |
YAxis | removePoint (Point point) |
Remove a point. | |
YAxis | setPoints (double[] pointvals) |
Set points from an array of doubles (for convenience). | |
YAxis | addPoint (double pointval) |
Add a point as a double (for convenience). | |
YAxis | removePoint (double pointval) |
Remove a point as a double (for convenience). | |
SortedSet< AxisError > | getErrors () |
Get the axis errors. | |
YAxis | setErrors (SortedSet< AxisError > axisErrors) |
Set the axis errors. | |
YAxis | setErrors (Collection< AxisError > axisErrors) |
Set the axis errors (from a generic collection). | |
YAxis | addError (AxisError axisError) |
Add an axis error. | |
YAxis | removeError (AxisError axisError) |
Remove an axis error. | |
SortedSet< Uncertainty > | getDatasetErrors () |
Get the errors from the parent dataset. | |
SortedSet< Uncertainty > | getAllErrors () |
Get all the errors, including those from the parent dataset. | |
Set< AxisProperty > | getProperties () |
Get the axis properties. | |
YAxis | setProperties (Set< AxisProperty > properties) |
Set the axis properties. | |
YAxis | addProperty (AxisProperty property) |
Add a property. | |
YAxis | removeProperty (AxisProperty property) |
Remove a property. | |
int | compareTo (YAxis other) |
Comparison operation. | |
String | toString () |
String representation. | |
String | toString (Integer indentBy) |
String representation with indent. | |
boolean | equals (Object other) |
Override equals comparison. | |
int | hashCode () |
Overriden hash code computation. | |
String | getHeader () |
Get the axis header. | |
Axis | setHeader (String header) |
Set the axis header. | |
Unit | getUnit () |
Get the Unit in which values on this axis are measured. | |
Axis | setUnit (Unit unit) |
Set the Unit in which values on this axis are measured. | |
Protected Attributes | |
Dataset | _dataset |
Parent dataset. | |
Package Functions | |
.hibernate.annotations. | Fetch (value=org.hibernate.annotations.FetchMode.JOIN)@org.hibernate.annotations.Cascade(value |
Collection of points. | |
.hibernate.annotations.CollectionOfElements.hibernate.annotations. | CollectionId (columns=@Column(name="AxisErrorId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type |
Collection of axis-level errors. | |
.hibernate.annotations. | Cascade (value={org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN}) private Set< AxisProperty > _properties |
Collection of properties, such as sqrt(s), Q^2 etc. | |
.hibernate.annotations. | Cascade (value={org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN}) private Set< AxisReaction > _reactions |
The reaction being measured. | |
.hibernate.annotations.CollectionOfElements.hibernate.annotations. | IndexColumn (name="Posn")@Column(name |
Collection of comments ie non-numerical properties. | |
.hibernate.annotations. | Type (type="cedar.hepdata.db.UnitUserType") private Unit _unit |
Unit which the points on this axis are measured in. | |
Logger | log () |
Neat method to allow every class to get hold of a custom-named Logger. | |
Package Attributes | |
.hibernate.annotations.CollectionOfElements.hibernate.annotations. | length |
A Dataset has one or more YAxes.
Definition at line 19 of file YAxis.java.
YAxis | ( | ) |
No-arg constructor.
Definition at line 77 of file YAxis.java.
00077 { 00078 super(); 00079 log().debug("Making a YAxis (0 arg constructor)"); 00080 }
Definition at line 82 of file YAxis.java.
00082 { 00083 this(); 00084 log().debug("Making a YAxis (1 arg constructor)"); 00085 setDataset(dataset); 00086 }
YAxis | ( | String | header, | |
String | observable, | |||
Unit | unit | |||
) |
Definition at line 88 of file YAxis.java.
00088 { 00089 this(); 00090 log().debug("Making a YAxis (3 arg constructor)"); 00091 setHeader(header); 00092 setObservable(observable); 00093 setUnit(unit); 00094 }
Definition at line 96 of file YAxis.java.
00096 { 00097 this(header, observable, unit); 00098 log().debug("Making a YAxis (4 arg constructor)"); 00099 setDataset(dataset); 00100 }
.hibernate.annotations. Fetch | ( | value | = org.hibernate.annotations.FetchMode.JOIN |
) | [package] |
Collection of points.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId | ( | columns | = @Column(name="AxisErrorId") , |
|
type | = @org.hibernate.annotations.Type(type="long") , |
|||
generator | = "sequence" | |||
) | [package] |
Collection of axis-level errors.
.hibernate.annotations. Cascade | ( | ) | [package] |
Collection of properties, such as sqrt(s), Q^2 etc.
ranges
.hibernate.annotations. Cascade | ( | ) | [package] |
The reaction being measured.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. IndexColumn | ( | name | = "Posn" |
) | [package] |
Collection of comments ie non-numerical properties.
Paper getPaper | ( | ) |
Get the Paper that this axis belongs to.
Note two degrees of separation, since there's a dataset in-between: watch out for null returns during hierarchy construction, e.g. in unpersisting from XML or database.
Definition at line 109 of file YAxis.java.
00109 { 00110 if (getDataset() != null) { 00111 return getDataset().getPaper(); 00112 } else { 00113 return null; 00114 } 00115 }
List<String> getComments | ( | ) |
YAxis setComments | ( | List< String > | comments | ) |
YAxis addComment | ( | String | comment | ) |
YAxis removeComment | ( | String | comment | ) |
Integer getId | ( | ) |
Get y-axis ID code.
Definition at line 140 of file YAxis.java.
Referenced by YAxis.compareTo(), and Point.setYAxis().
YAxis setId | ( | Integer | yAxisId | ) |
Dataset getDataset | ( | ) |
Get the Dataset that this axis belongs to.
Definition at line 151 of file YAxis.java.
Referenced by Point.getBins(), and Point.getPoints().
00151 { 00152 return _dataset; 00153 }
Over-ride dataset assignment, to get null IDs right.
Definition at line 155 of file YAxis.java.
References Dataset.getYAxes().
Referenced by Dataset.addYAxis().
00155 { 00156 log().debug("Calling setDataset()"); 00157 _dataset = dataset; 00158 if (dataset != null) { 00159 if (getId() == null) { 00160 int highestId = 0; 00161 if (dataset.getYAxes().size() > 0) { 00162 highestId = dataset.getYAxes().last().getId(); 00163 } 00164 log().debug("Incrementing y-axis ID: " + (highestId + 1)); 00165 setId(highestId + 1); 00166 } 00167 log().debug("Adding myself to a Dataset"); 00168 dataset.getYAxes().add(this); 00169 } 00170 return this; 00171 }
SortedSet<XAxis> getXAxes | ( | ) |
Get associated x-axes.
Definition at line 175 of file YAxis.java.
00175 { 00176 if (getDataset() != null) { 00177 return getDataset().getXAxes(); 00178 } else { 00179 return null; 00180 } 00181 }
Set<AxisReaction> getReactions | ( | ) |
YAxis setReactions | ( | Set< AxisReaction > | reactions | ) |
Set reactions.
Definition at line 189 of file YAxis.java.
00189 { 00190 getReactions().clear(); 00191 for (AxisReaction r : reactions) addReaction(r); 00192 return this; 00193 }
YAxis addReaction | ( | AxisReaction | reaction | ) |
Add a reaction.
Definition at line 195 of file YAxis.java.
References AxisReaction.setYAxis().
00195 { 00196 if (reaction != null) { 00197 reaction.setYAxis(this); 00198 } else { 00199 log().warn("Tried to add a null reaction to a y-axis"); 00200 } 00201 return this; 00202 }
YAxis removeReaction | ( | AxisReaction | reaction | ) |
Remove a reaction.
Definition at line 204 of file YAxis.java.
References AxisReaction.setYAxis().
00204 { 00205 if (reaction != null) { 00206 reaction.setYAxis(null); 00207 _reactions.remove(reaction); 00208 } else { 00209 log().warn("Tried to remove a null reaction from a y-axis"); 00210 } 00211 return this; 00212 }
String getObservable | ( | ) |
YAxis setObservable | ( | String | observable | ) |
SortedSet<Point> getPoints | ( | ) |
Get points.
Definition at line 229 of file YAxis.java.
Referenced by Data.makeExampleYAxes(), and Point.setYAxis().
Point getPoint | ( | Integer | pointId | ) |
Get a specific point from this axis by point ID code.
Definition at line 234 of file YAxis.java.
Referenced by Dataset.getPoints().
00234 { 00235 Point thePoint = null; 00236 for (Point p : getPoints()) { 00237 if (p.getId().equals(pointId)) { 00238 thePoint = p; 00239 break; 00240 } 00241 } 00242 return thePoint; 00243 }
Explicit set-points-from-SortedSet to keep reflection apps happy.
Definition at line 246 of file YAxis.java.
References Point.getPoints().
Referenced by Data.makeExampleYAxes().
00246 { 00247 log().debug("Calling setPoints(SortedSet<Point>)"); 00248 this.getPoints().clear(); 00249 for (Point p : points) addPoint(p); 00250 return this; 00251 }
Set points from a Collection.
Definition at line 254 of file YAxis.java.
00254 { 00255 log().debug("Calling setPoints(Collection<Point>)"); 00256 this.getPoints().clear(); 00257 for (Point p : points) addPoint(p); 00258 return this; 00259 }
Set points from an array.
Definition at line 262 of file YAxis.java.
00262 { 00263 setPoints(Arrays.asList(points)); 00264 return this; 00265 }
Add a point.
Definition at line 268 of file YAxis.java.
References Point.setYAxis().
00268 { 00269 if (point != null) { 00270 point.setYAxis(this); 00271 } else { 00272 log().warn("Tried to add a null Point to a YAxis"); 00273 } 00274 return this; 00275 }
Remove a point.
Definition at line 278 of file YAxis.java.
00278 { 00279 log().debug("Removing point: " + point); 00280 if (point != null) { 00281 getPoints().remove(point); 00282 } else { 00283 log().warn("Tried to remove a null Point from a YAxis"); 00284 } 00285 log().debug("Removing point: done"); 00286 return this; 00287 }
YAxis setPoints | ( | double[] | pointvals | ) |
Set points from an array of doubles (for convenience).
Definition at line 290 of file YAxis.java.
References Point.getPoints().
00290 { 00291 this.getPoints().clear(); 00292 for (Double pv : pointvals) addPoint(pv); 00293 return this; 00294 }
YAxis addPoint | ( | double | pointval | ) |
Add a point as a double (for convenience).
Definition at line 297 of file YAxis.java.
00297 { 00298 return addPoint(new Point(pointval)); 00299 }
YAxis removePoint | ( | double | pointval | ) |
Remove a point as a double (for convenience).
Definition at line 302 of file YAxis.java.
00302 { 00303 return removePoint(new Point(pointval)); 00304 }
SortedSet<AxisError> getErrors | ( | ) |
Set the axis errors.
Definition at line 312 of file YAxis.java.
00312 { 00313 getErrors().clear(); 00314 for (AxisError e : axisErrors) addError(e); 00315 return this; 00316 }
Set the axis errors (from a generic collection).
Definition at line 318 of file YAxis.java.
00318 { 00319 getErrors().clear(); 00320 for (AxisError e : axisErrors) addError(e); 00321 return this; 00322 }
Add an axis error.
Definition at line 324 of file YAxis.java.
References AxisError.setAxis().
Referenced by Data.makeExampleYAxes().
00324 { 00325 if (axisError != null) { 00326 axisError.setAxis(this); 00327 } else { 00328 log().warn("Tried to add a null AxisError to a YAxis"); 00329 } 00330 return this; 00331 }
Remove an axis error.
Definition at line 333 of file YAxis.java.
00333 { 00334 if (axisError != null) { 00335 getErrors().remove(axisError); 00336 } else { 00337 log().warn("Tried to remove a null AxisError from a YAxis"); 00338 } 00339 return this; 00340 }
SortedSet<Uncertainty> getDatasetErrors | ( | ) |
Get the errors from the parent dataset.
Definition at line 344 of file YAxis.java.
00344 { 00345 SortedSet<Uncertainty> dsErrors = new TreeSet<Uncertainty>(); 00346 if (getDataset() != null) { 00347 dsErrors.addAll( getDataset().getErrors() ); 00348 } 00349 return dsErrors; 00350 }
SortedSet<Uncertainty> getAllErrors | ( | ) |
Get all the errors, including those from the parent dataset.
Definition at line 352 of file YAxis.java.
00352 { 00353 SortedSet<Uncertainty> allErrors = new TreeSet<Uncertainty>(); 00354 allErrors.addAll(getErrors()); 00355 allErrors.addAll(getDatasetErrors()); 00356 return allErrors; 00357 }
Set<AxisProperty> getProperties | ( | ) |
YAxis setProperties | ( | Set< AxisProperty > | properties | ) |
YAxis addProperty | ( | AxisProperty | property | ) |
Add a property.
Definition at line 370 of file YAxis.java.
00370 { 00371 if (property != null) { 00372 property.setYAxis(this); 00373 _properties.add(property); 00374 } else { 00375 log().warn("Tried to add a null AxisProperty to a YAxis"); 00376 } 00377 return this; 00378 }
YAxis removeProperty | ( | AxisProperty | property | ) |
Remove a property.
Definition at line 380 of file YAxis.java.
00380 { 00381 if (property != null) { 00382 property.setYAxis(null); 00383 _properties.remove(property); 00384 } else { 00385 log().warn("Tried to remove a null AxisProperty from a YAxis"); 00386 } 00387 return this; 00388 }
int compareTo | ( | YAxis | other | ) |
Comparison operation.
Definition at line 395 of file YAxis.java.
References YAxis.getId().
00395 { 00396 log().debug("Comparing y-axes..."); 00397 if (getId() == null) { 00398 log().debug("Null YAxis ID"); 00399 return 1; // Sort null y-axes at the end 00400 } else if (getId() > other.getId()) { 00401 log().debug("Greater than"); 00402 return 1; 00403 } else if (getId() < other.getId()) { 00404 log().debug("Less than"); 00405 return -1; 00406 } else { 00407 log().debug("Equal to"); 00408 return 0; 00409 } 00410 }
String toString | ( | ) |
String representation.
Reimplemented from Axis.
Definition at line 417 of file YAxis.java.
00417 { 00418 return toString(0); 00419 }
String toString | ( | Integer | indentBy | ) |
String representation with indent.
Definition at line 422 of file YAxis.java.
00422 { 00423 log().debug("Writing out y-axis as a string"); 00424 StringBuffer s = new StringBuffer(); 00425 String indent = ""; 00426 for (int i = 0; i < indentBy; ++i) indent += " "; 00427 00428 s.append(indent + "Y-axis ID: " + getId() + "\n"); 00429 s.append(indent + "Header: " + getHeader()); 00430 s.append(indent + "Observable: " + getObservable()); 00431 for (Point point : getPoints()) { 00432 s.append("\n" + point.toString(indentBy + 2)); 00433 } 00434 return s.toString(); 00435 }
boolean equals | ( | Object | other | ) |
Override equals comparison.
Definition at line 442 of file YAxis.java.
00442 { 00443 if (this == other) return true; 00444 if (! (other instanceof YAxis)) return false; 00445 return hashCode() == other.hashCode(); 00446 }
int hashCode | ( | ) |
Overriden hash code computation.
Definition at line 450 of file YAxis.java.
Referenced by AxisError.hashCode().
00450 { 00451 int code = 31; 00452 if (getDataset() != null) code ^= getDataset().hashCode(); 00453 if (getHeader() != null) code ^= getHeader().hashCode(); 00454 if (getUnit() != null) code ^= getUnit().hashCode(); 00455 return code; 00456 }
.hibernate.annotations. Type | ( | type | = "cedar.hepdata.db.UnitUserType" |
) | [package, inherited] |
Unit which the points on this axis are measured in.
String getHeader | ( | ) | [inherited] |
Axis setHeader | ( | String | header | ) | [inherited] |
Unit getUnit | ( | ) | [inherited] |
Axis setUnit | ( | Unit | unit | ) | [inherited] |
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().
.hibernate.annotations.CollectionOfElements.hibernate.annotations. length [package] |
Initial value:
10000) private List<String> _comments = new Vector<String>()
Definition at line 65 of file YAxis.java.