Public Member Functions | |
Dataset () | |
Default constructor. | |
Dataset (Paper paper) | |
Constructor with containing paper as an argument. | |
Integer | getId () |
Get local dataset ID. | |
Dataset | setId (Integer datasetId) |
Set local dataset ID. | |
Paper | getPaper () |
Get parent paper. | |
Dataset | setPaper (Paper paper) |
Set parent paper. | |
List< String > | getComments () |
Get comments. | |
Dataset | setComments (List< String > comments) |
Set comments. | |
Dataset | addComment (String comment) |
Add a comment. | |
Dataset | removeComment (String comment) |
Delete a comment. | |
Set< DatasetProperty > | getProperties () |
Get dataset properties. | |
Dataset | setProperties (Set< DatasetProperty > properties) |
Set dataset properties. | |
Dataset | addProperty (DatasetProperty property) |
Add a dataset property. | |
Dataset | removeProperty (DatasetProperty property) |
Delete a dataset property. | |
SortedSet< DatasetError > | getErrors () |
Get dataset errors. | |
Dataset | setErrors (SortedSet< DatasetError > datasetErrors) |
Set dataset errors. | |
Dataset | setErrors (Collection< DatasetError > datasetErrors) |
Set dataset errors. | |
Dataset | setErrors (DatasetError[] datasetErrors) |
Set dataset errors. | |
Dataset | addError (DatasetError datasetError) |
Add a dataset error. | |
Dataset | removeError (DatasetError datasetError) |
Remove a dataset error. | |
SortedSet< XAxis > | getXAxes () |
Get constituent x-axes. | |
XAxis | getXAxis (Integer xAxisId) |
Set constituent x-axes. | |
Dataset | setXAxes (SortedSet< XAxis > xAxes) |
Set constituent x-axes. | |
Dataset | setXAxes (Collection< XAxis > xAxes) |
Set constituent x-axes. | |
Dataset | setXAxes (XAxis[] xAxes) |
Set constituent x-axes. | |
Dataset | addXAxis (XAxis xAxis) |
Add an x-axis. | |
Dataset | removeXAxis (XAxis xAxis) |
Remove a constituent x-axis. | |
SortedSet< YAxis > | getYAxes () |
Get constituent y-axes. | |
YAxis | getYAxis (Integer yAxisId) |
Set constituent y-axes. | |
Dataset | setYAxes (SortedSet< YAxis > yAxes) |
Set constituent y-axes. | |
Dataset | setYAxes (Collection< YAxis > yAxes) |
Set constituent y-axes. | |
Dataset | setYAxes (YAxis[] yAxes) |
Set constituent y-axes. | |
Dataset | addYAxis (YAxis yAxis) |
Add a y-axis. | |
Dataset | removeYAxis (YAxis yAxis) |
Remove a constituent y-axis. | |
SortedSet< Bin > | getBins (Integer binId) |
Get the set of bins in this dataset with bin ID = binId. | |
SortedSet< Point > | getPoints (Integer pointId) |
Get the set of points in this dataset with point ID = pointId. | |
int | compareTo (Dataset other) |
Compare datasets. | |
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. | Cascade (value={org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN}) private Set< DatasetProperty > _properties |
Searchable dataset properties. | |
.hibernate.annotations.CollectionOfElements.hibernate.annotations. | CollectionId (columns=@Column(name="DatasetErrorId"), type=@org.hibernate.annotations.Type(type="long"), generator="sequence")@org.hibernate.annotations.Sort(type |
Sorted set of dataset-level errors. | |
.hibernate.annotations.CollectionOfElements.hibernate.annotations. | IndexColumn (name="Posn")@Column(name |
Comments. | |
.hibernate.annotations. | Fetch (value=org.hibernate.annotations.FetchMode.SUBSELECT)@org.hibernate.annotations.Cascade(value |
Contained x-axes. | |
.hibernate.annotations. | Fetch (value=org.hibernate.annotations.FetchMode.SUBSELECT)@org.hibernate.annotations.Cascade(value |
Contained y-axes. | |
Logger | log () |
Neat method to allow every class to get hold of a custom-named Logger. | |
Package Attributes | |
.hibernate.annotations.CollectionOfElements.hibernate.annotations. | length |
Definition at line 18 of file Dataset.java.
Dataset | ( | ) |
Constructor with containing paper as an argument.
Definition at line 81 of file Dataset.java.
00081 { 00082 this(); 00083 setPaper(paper); 00084 }
.hibernate.annotations. Cascade | ( | ) | [package] |
Searchable dataset properties.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. CollectionId | ( | columns | = @Column(name="DatasetErrorId") , |
|
type | = @org.hibernate.annotations.Type(type="long") , |
|||
generator | = "sequence" | |||
) | [package] |
Sorted set of dataset-level errors.
.hibernate.annotations.CollectionOfElements.hibernate.annotations. IndexColumn | ( | name | = "Posn" |
) | [package] |
Comments.
.hibernate.annotations. Fetch | ( | value | = org.hibernate.annotations.FetchMode.SUBSELECT |
) | [package] |
Contained x-axes.
.hibernate.annotations. Fetch | ( | value | = org.hibernate.annotations.FetchMode.SUBSELECT |
) | [package] |
Contained y-axes.
Integer getId | ( | ) |
Get local dataset ID.
Definition at line 92 of file Dataset.java.
Referenced by Dataset.compareTo().
Dataset setId | ( | Integer | datasetId | ) |
Paper getPaper | ( | ) |
Set parent paper.
Definition at line 110 of file Dataset.java.
References Paper.getDatasets().
Referenced by Paper.addDataset().
00110 { 00111 if (paper != null) { 00112 if (getId() == null) { 00113 int highestId = 0; 00114 if (paper.getDatasets().size() > 0) { 00115 highestId = paper.getDatasets().last().getId(); 00116 } 00117 log().debug("Incrementing dataset ID: " + (highestId + 1)); 00118 setId(highestId + 1); 00119 } 00120 paper.getDatasets().add(this); 00121 _paper = paper; 00122 } 00123 return this; 00124 }
List<String> getComments | ( | ) |
Dataset setComments | ( | List< String > | comments | ) |
Dataset addComment | ( | String | comment | ) |
Add a comment.
Definition at line 139 of file Dataset.java.
Referenced by Data.makeExampleDataset().
Dataset removeComment | ( | String | comment | ) |
Set<DatasetProperty> getProperties | ( | ) |
Dataset setProperties | ( | Set< DatasetProperty > | properties | ) |
Dataset addProperty | ( | DatasetProperty | property | ) |
Add a dataset property.
Definition at line 164 of file Dataset.java.
00164 { 00165 if (property != null) { 00166 property.setDataset(this); 00167 _properties.add(property); 00168 } else { 00169 log().warn("Tried to add a null DatasetProperty to a Dataset"); 00170 } 00171 return this; 00172 }
Dataset removeProperty | ( | DatasetProperty | property | ) |
Delete a dataset property.
Definition at line 175 of file Dataset.java.
00175 { 00176 if (property != null) { 00177 _properties.remove(property); 00178 property.setDataset(null); 00179 } else { 00180 log().warn("Tried to remove a null DatasetProperty from a Dataset"); 00181 } 00182 return this; 00183 }
SortedSet<DatasetError> getErrors | ( | ) |
Get dataset errors.
Definition at line 188 of file Dataset.java.
Referenced by DatasetError.setDataset().
Dataset setErrors | ( | SortedSet< DatasetError > | datasetErrors | ) |
Set dataset errors.
Definition at line 193 of file Dataset.java.
00193 { 00194 getErrors().clear(); 00195 for (DatasetError e : datasetErrors) addError(e); 00196 return this; 00197 }
Dataset setErrors | ( | Collection< DatasetError > | datasetErrors | ) |
Set dataset errors.
Definition at line 200 of file Dataset.java.
00200 { 00201 getErrors().clear(); 00202 for (DatasetError e : datasetErrors) addError(e); 00203 return this; 00204 }
Dataset setErrors | ( | DatasetError[] | datasetErrors | ) |
Set dataset errors.
Definition at line 207 of file Dataset.java.
00207 { 00208 setErrors(Arrays.asList(datasetErrors)); 00209 return this; 00210 }
Dataset addError | ( | DatasetError | datasetError | ) |
Add a dataset error.
Definition at line 213 of file Dataset.java.
References DatasetError.setDataset().
00213 { 00214 if (datasetError != null) { 00215 datasetError.setDataset(this); 00216 } else { 00217 log().warn("Tried to add a null DatasetError to a Dataset"); 00218 } 00219 return this; 00220 }
Dataset removeError | ( | DatasetError | datasetError | ) |
Remove a dataset error.
Definition at line 223 of file Dataset.java.
00223 { 00224 if (datasetError != null) { 00225 getErrors().remove(datasetError); 00226 } else { 00227 log().warn("Tried to remove a null DatasetError from a Dataset"); 00228 } 00229 return this; 00230 }
SortedSet<XAxis> getXAxes | ( | ) |
Get constituent x-axes.
Definition at line 235 of file Dataset.java.
Referenced by XAxis.setDataset().
XAxis getXAxis | ( | Integer | xAxisId | ) |
Set constituent x-axes.
Definition at line 240 of file Dataset.java.
00240 { 00241 XAxis theXAxis = null; 00242 for (XAxis x : getXAxes()) { 00243 if (x.getId().equals(xAxisId)) { 00244 theXAxis = x; 00245 break; 00246 } 00247 } 00248 return theXAxis; 00249 }
Set constituent x-axes.
Definition at line 252 of file Dataset.java.
00252 { 00253 getXAxes().clear(); 00254 for (XAxis x : xAxes) addXAxis(x); 00255 return this; 00256 }
Set constituent x-axes.
Definition at line 259 of file Dataset.java.
00259 { 00260 getXAxes().clear(); 00261 for (XAxis x : xAxes) addXAxis(x); 00262 return this; 00263 }
Set constituent x-axes.
Definition at line 266 of file Dataset.java.
00266 { 00267 setXAxes(Arrays.asList(xAxes)); 00268 return this; 00269 }
Add an x-axis.
Definition at line 272 of file Dataset.java.
References XAxis.setDataset().
Referenced by Data.makeExample().
00272 { 00273 if (xAxis != null) { 00274 xAxis.setDataset(this); 00275 } else { 00276 log().warn("Tried to add a null XAxis to a Dataset"); 00277 } 00278 return this; 00279 }
Remove a constituent x-axis.
Definition at line 282 of file Dataset.java.
00282 { 00283 if (xAxis != null) { 00284 _xAxes.remove(xAxis); 00285 } else { 00286 log().warn("Tried to remove a null XAxis from a Dataset"); 00287 } 00288 return this; 00289 }
SortedSet<YAxis> getYAxes | ( | ) |
Get constituent y-axes.
Definition at line 295 of file Dataset.java.
Referenced by YAxis.setDataset().
YAxis getYAxis | ( | Integer | yAxisId | ) |
Set constituent y-axes.
Definition at line 300 of file Dataset.java.
00300 { 00301 YAxis theYAxis = null; 00302 for (YAxis y : getYAxes()) { 00303 if (y.getId().equals(yAxisId)) { 00304 theYAxis = y; 00305 break; 00306 } 00307 } 00308 return theYAxis; 00309 }
Set constituent y-axes.
Definition at line 312 of file Dataset.java.
00312 { 00313 getYAxes().clear(); 00314 for (YAxis y : yAxes) addYAxis(y); 00315 return this; 00316 }
Set constituent y-axes.
Definition at line 319 of file Dataset.java.
00319 { 00320 getYAxes().clear(); 00321 for (YAxis y : yAxes) addYAxis(y); 00322 return this; 00323 }
Set constituent y-axes.
Definition at line 326 of file Dataset.java.
00326 { 00327 setYAxes(Arrays.asList(yAxes)); 00328 return this; 00329 }
Add a y-axis.
Definition at line 332 of file Dataset.java.
References YAxis.setDataset().
Referenced by Data.makeExample().
00332 { 00333 if (yAxis != null) { 00334 yAxis.setDataset(this); 00335 } else { 00336 log().warn("Tried to add a null YAxis to a Dataset"); 00337 } 00338 return this; 00339 }
Remove a constituent y-axis.
Definition at line 342 of file Dataset.java.
00342 { 00343 if (yAxis != null) { 00344 _yAxes.add(yAxis); 00345 } else { 00346 log().warn("Tried to remove a null XAxis from a Dataset"); 00347 } 00348 return this; 00349 }
SortedSet<Bin> getBins | ( | Integer | binId | ) |
Get the set of bins in this dataset with bin ID = binId.
The bins set will be sorted in order of the IDs of the containing x-axes.
Definition at line 359 of file Dataset.java.
Referenced by Point.getBins(), and Bin.getBins().
00359 { 00360 SortedSet<Bin> matchingBins = new TreeSet<Bin>(); 00361 for (XAxis x : getXAxes()) { 00362 Bin mybin = x.getBin(binId); 00363 if (mybin != null) { 00364 matchingBins.add(mybin); 00365 } 00366 } 00367 return matchingBins; 00368 }
SortedSet<Point> getPoints | ( | Integer | pointId | ) |
Get the set of points in this dataset with point ID = pointId.
The points set will be sorted in order of the IDs of the containing y-axes.
Definition at line 372 of file Dataset.java.
References YAxis.getPoint().
Referenced by Point.getPoints(), and Bin.getPoints().
00372 { 00373 SortedSet<Point> matchingPoints = new TreeSet<Point>(); 00374 for (YAxis y : getYAxes()) { 00375 Point mypoint = y.getPoint(pointId); 00376 if (mypoint != null) { 00377 matchingPoints.add(mypoint); 00378 } 00379 } 00380 return matchingPoints; 00381 }
int compareTo | ( | Dataset | other | ) |
Compare datasets.
Definition at line 390 of file Dataset.java.
References Dataset.getId().
00390 { 00391 log().debug("Comparing datasets..."); 00392 if (getId() == null) { 00393 log().warn("Null dataset ID"); 00394 return 1; // Sort null datasets at the end 00395 } else if (getId() > other.getId()) { 00396 log().debug("Greater than"); 00397 return 1; 00398 } else if (getId() < other.getId()) { 00399 log().debug("Less than"); 00400 return -1; 00401 } else { 00402 log().debug("Equal to"); 00403 return 0; 00404 } 00405 }
String toString | ( | ) |
String representation.
Reimplemented from Storeable.
Definition at line 414 of file Dataset.java.
00414 { 00415 return toString(0); 00416 }
String toString | ( | Integer | indentBy | ) |
String representation with indent.
Definition at line 419 of file Dataset.java.
00419 { 00420 log().debug("Writing out dataset as a string"); 00421 String indent = ""; 00422 for (int i = 0; i < indentBy; ++i) indent += " "; 00423 StringBuffer s = new StringBuffer(); 00424 00425 // Dataset comments 00426 s.append(indent + "Dataset ID: " + getId() + "\n"); 00427 if (! getComments().isEmpty()) { 00428 s.append(indent + "Comments: "); 00429 for (String comment : getComments()) { 00430 s.append("\n" + indent + comment); 00431 } 00432 s.append("\n"); 00433 } 00434 00435 // Axes 00436 s.append(indent + getXAxes().size() + " x-axes, "); 00437 s.append(indent + getYAxes().size() + " y-axes"); 00438 for (XAxis xaxis : getXAxes()) { 00439 log().debug("Getting x-axis string representation"); 00440 s.append("\n" + xaxis.toString(indentBy + 2)); 00441 } 00442 for (YAxis yaxis : getYAxes()) { 00443 log().debug("Getting y-axis string representation"); 00444 s.append("\n" + yaxis.toString(indentBy + 2)); 00445 } 00446 s.append("\n"); 00447 00448 // Dataset errors 00449 if (! getErrors().isEmpty()) { 00450 s.append(indent + "Dataset errors:"); 00451 for (Uncertainty err : getErrors()) { 00452 log().debug("Getting dataset error string representation"); 00453 s.append("\n" + err.toString(indentBy + 2)); 00454 } 00455 } 00456 00457 return s.toString(); 00458 }
boolean equals | ( | Object | other | ) |
Overridden equals comparison.
Definition at line 465 of file Dataset.java.
00465 { 00466 if (this == other) return true; 00467 if (! (other instanceof Dataset)) return false; 00468 return hashCode() == other.hashCode(); 00469 }
int hashCode | ( | ) |
Overridden hashCode.
Definition at line 472 of file Dataset.java.
00472 { 00473 int code = 31; 00474 if (getPaper() != null) code ^= getPaper().hashCode(); 00475 if (getId() != null) code ^= getId().hashCode(); 00476 for (String c : getComments()) code ^= c.hashCode(); 00477 return code; 00478 }
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 51 of file Dataset.java.