Observable Class Reference

An observable that corresponds to any number of YAxiss. More...

Inheritance diagram for Observable:

Inheritance graph
[legend]

Collaboration diagram for Observable:

Collaboration graph
[legend]

List of all members.


Public Member Functions

 Observable ()
 Default constructor.
 Observable (String name)
 Named constructor.
 Observable (String name, Unit unit)
 Named constructor with a Unit.
String getName ()
Observable setName (String name)
String getDescription ()
Observable setDescription (String description)
Unit getCanonicalUnit ()
 Get the typical unit used for representing this Observable.
Observable setCanonicalUnit (Unit canonicalUnit)
 Set the typical unit used for representing this Observable.
Set< ObservableGroupgetObservableGroups ()
Observable setObservableGroups (Set< ObservableGroup > observableGroups)
Observable addObservableGroup (ObservableGroup observableGroup)
Observable removeObservableGroup (ObservableGroup observableGroup)
Set< YAxisgetYAxes ()
Observable setYAxes (Set< YAxis > yAxes)
Observable addYAxis (YAxis yAxis)
Observable removeYAxis (YAxis yAxis)
String toString ()
 Default String representation: declares that method is not properly defined by default.

Package Functions

.hibernate.annotations. Cascade (value={org.hibernate.annotations.CascadeType.ALL}) private Set< YAxis > _yAxes
 Y-axes which contain this observable.
.hibernate.annotations. Type (type="cedar.hepdata.db.UnitUserType") private Unit _canonicalUnit
 Canonical unit for this observable.
Logger log ()
 Neat method to allow every class to get hold of a custom-named Logger.

Detailed Description

An observable that corresponds to any number of YAxiss.

It is also a member of (in general several) ObservableGroups.

Author:
Andy Buckley
Version:
Date
Revision

Definition at line 19 of file Observable.java.


Constructor & Destructor Documentation

Observable (  ) 

Default constructor.

Definition at line 52 of file Observable.java.

00052 {}

Observable ( String  name  ) 

Named constructor.

Definition at line 55 of file Observable.java.

00055                                    {
00056         log().debug("Calling 1 arg constructor");
00057         setName(name);
00058     }

Observable ( String  name,
Unit  unit 
)

Named constructor with a Unit.

Definition at line 61 of file Observable.java.

00061                                               {
00062         this(name);
00063         log().debug("Calling 2 arg constructor");
00064         setCanonicalUnit(unit);
00065     }


Member Function Documentation

.hibernate.annotations. Cascade (  )  [package]

Y-axes which contain this observable.

.hibernate.annotations. Type ( type  = "cedar.hepdata.db.UnitUserType"  )  [package]

Canonical unit for this observable.

String getName (  ) 

Definition at line 72 of file Observable.java.

00072                             {
00073         return _name;
00074     }

Observable setName ( String  name  ) 

Definition at line 75 of file Observable.java.

00075                                            {
00076         _name = name;
00077         return this;
00078     }

String getDescription (  ) 

Definition at line 82 of file Observable.java.

00082                                    {
00083         return _description;
00084     }

Observable setDescription ( String  description  ) 

Definition at line 85 of file Observable.java.

00085                                                          {
00086         _description = description;
00087         return this;
00088     }

Unit getCanonicalUnit (  ) 

Get the typical unit used for representing this Observable.

It doesn't have to be canonical in the Unit.canonicalUnit() sense!

Definition at line 94 of file Observable.java.

00094                                    {
00095         return _canonicalUnit;
00096     }

Observable setCanonicalUnit ( Unit  canonicalUnit  ) 

Set the typical unit used for representing this Observable.

It doesn't have to be canonical in the Unit.canonicalUnit() sense!

Definition at line 100 of file Observable.java.

00100                                                            {
00101         _canonicalUnit = canonicalUnit;
00102         return this;
00103     }

Set<ObservableGroup> getObservableGroups (  ) 

Definition at line 107 of file Observable.java.

Referenced by ObservableGroup.addObservable(), and ObservableGroup.removeObservable().

00107                                                       {
00108         return _observableGroups;
00109     }

Observable setObservableGroups ( Set< ObservableGroup observableGroups  ) 

Todo:
Bidirectional?

Definition at line 110 of file Observable.java.

00110                                                                                  {
00112         _observableGroups = observableGroups;
00113         return this;
00114     }

Observable addObservableGroup ( ObservableGroup  observableGroup  ) 

Definition at line 115 of file Observable.java.

References ObservableGroup.getObservables().

00115                                                                           {
00116         if (observableGroup != null) {
00117             observableGroup.getObservables().add(this);
00118             _observableGroups.add(observableGroup);
00119         } else {
00120             log().warn("Tried to add a null ObservableGroup to an Observable");
00121         }
00122         return this;
00123     }

Observable removeObservableGroup ( ObservableGroup  observableGroup  ) 

Definition at line 124 of file Observable.java.

References ObservableGroup.getObservables().

00124                                                                              {
00125         if (observableGroup != null) {
00126             observableGroup.getObservables().remove(this);
00127             _observableGroups.remove(observableGroup);
00128         } else {
00129             log().warn("Tried to remove a null ObservableGroup from an Observable");
00130         }
00131         return this;
00132     }

Set<YAxis> getYAxes (  ) 

Definition at line 136 of file Observable.java.

Referenced by YAxis.setObservable().

00136                                  {
00137         return _yAxes;
00138     }

Observable setYAxes ( Set< YAxis yAxes  ) 

Todo:
Bidirectional?

Definition at line 139 of file Observable.java.

00139                                                  {
00141         _yAxes = yAxes;
00142         return this;
00143     }

Observable addYAxis ( YAxis  yAxis  ) 

Definition at line 144 of file Observable.java.

References YAxis.setObservable().

00144                                             {
00145         if (yAxis != null) {
00146             _yAxes.add(yAxis);
00147             yAxis.setObservable(this);
00148         } else {
00149             log().warn("Tried to add a null YAxis to an Observable");
00150         }
00151         return this;
00152     }

Observable removeYAxis ( YAxis  yAxis  ) 

Definition at line 153 of file Observable.java.

References YAxis.setObservable().

00153                                                {
00154         if (yAxis != null) {
00155             _yAxes.remove(yAxis);
00156             yAxis.setObservable(null);
00157         } else {
00158             log().warn("Tried to remove a null YAxis from an Observable");
00159         }
00160         return this;
00161     }

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     }

String toString (  )  [inherited]

Default String representation: declares that method is not properly defined by default.

Reimplemented in Axis, Bin, Data, Dataset, Experiment, Modification, Paper, Particle, Point, Property, Reaction, Reference, Uncertainty, XAxis, and YAxis.

Definition at line 19 of file Storeable.java.

00019                              {
00020         StringBuffer s = new StringBuffer();
00021         s.append(this.getClass().getName() + ".toString() is not overloaded.");
00022         return s.toString();
00023     }


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