Particle Class Reference

A particle in a Reaction's final state or initial state collection. More...

Inheritance diagram for Particle:

Inheritance graph
[legend]

Collaboration diagram for Particle:

Collaboration graph
[legend]

List of all members.


Public Member Functions

 Particle ()
 No-arg contructor.
 Particle (Integer pdgCode)
 Particle (String name)
 Particle (String name, Integer multiplicity)
 Particle (String name, Integer multiplicity, Relation relation)
Integer getPDGCode ()
 Get PDG code.
Particle setPDGCode (Integer pdgCode)
 Set PDG code.
String getName ()
 Get particle name.
Particle setName (String name)
 Set particle name.
Integer getMultiplicity ()
 Get multiplicity.
Particle setMultiplicity (Integer multiplicity)
 Set multiplicity.
Relation getMultRelation ()
 Get the multiplicity relation.
Particle setMultRelation (Relation multRelation)
 Set the multiplicity relation.
String getHtmlName () throws HDException
 Get HTML version of the particle name, using YaPPI.
String getTexName () throws HDException
 Get TeX version of the particle name, using YaPPI.
boolean equals (Object other)
 Compare particles for equality.
int hashCode ()
 Specific hashCode.
String toString ()
 Default String representation: declares that method is not properly defined by default.

Static Public Member Functions

static Boolean sameType (Particle a, Particle b)

Package Functions

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

Detailed Description

A particle in a Reaction's final state or initial state collection.

A particle in this sense also encodes the multiplicity of the particle in the reaction, possibly with an inequality on the multiplicity relation.

Todo:
Base this around YaPPI and just store the PDG code
Author:
Andy Buckley
Version:
Date
Revision

Definition at line 18 of file Particle.java.


Constructor & Destructor Documentation

Particle (  ) 

No-arg contructor.

Definition at line 41 of file Particle.java.

00041 {}

Particle ( Integer  pdgCode  ) 

Definition at line 43 of file Particle.java.

References Particle.setPDGCode().

00043                                      {
00044         setPDGCode(pdgCode);
00045     }

Particle ( String  name  ) 

Definition at line 47 of file Particle.java.

References Particle.setName().

00047                                  {
00048         setName(name);
00049     }

Particle ( String  name,
Integer  multiplicity 
)

Definition at line 51 of file Particle.java.

References Particle.setMultiplicity().

00051                                                        {
00052         this(name);
00053         setMultiplicity(multiplicity);
00054     }

Particle ( String  name,
Integer  multiplicity,
Relation  relation 
)

Definition at line 56 of file Particle.java.

References Particle.setMultRelation().

00056                                                                           {
00057         this(name, multiplicity);
00058         setMultRelation(relation);
00059     }


Member Function Documentation

static Boolean sameType ( Particle  a,
Particle  b 
) [static]

Definition at line 66 of file Particle.java.

References Particle.getName(), and Particle.getPDGCode().

00066                                                            {
00067         return a.getPDGCode() == b.getPDGCode() || a.getName() == b.getName();
00068     }

Integer getPDGCode (  ) 

Get PDG code.

Definition at line 75 of file Particle.java.

Referenced by Particle.hashCode(), and Particle.sameType().

00075                                 {
00076         return pdgCode;
00077     }

Particle setPDGCode ( Integer  pdgCode  ) 

Set PDG code.

Definition at line 79 of file Particle.java.

References Particle.pdgCode.

Referenced by Particle.Particle().

00079                                                 {
00080         this.pdgCode = pdgCode;
00081         return this;
00082     }

String getName (  ) 

Get particle name.

Todo:
Use YaPPI

Definition at line 88 of file Particle.java.

Referenced by Particle.sameType(), and Particle.toString().

00088                             {
00089         return name;
00090     }

Particle setName ( String  name  ) 

Set particle name.

Todo:
Use YaPPI and ditch this method

Definition at line 94 of file Particle.java.

References Particle.name.

Referenced by Particle.Particle().

00094                                          {
00095         this.name = name;
00096         return this;
00097     }

Integer getMultiplicity (  ) 

Get multiplicity.

Definition at line 101 of file Particle.java.

Referenced by Reaction.addToFinalState(), Reaction.addToInitialState(), Particle.hashCode(), Reaction.removeFromFinalState(), Reaction.removeFromInitialState(), and Particle.toString().

00101                                      {
00102         return multiplicity;
00103     }

Particle setMultiplicity ( Integer  multiplicity  ) 

Set multiplicity.

Definition at line 105 of file Particle.java.

References Particle.multiplicity.

Referenced by Particle.Particle().

00105                                                           {
00106         this.multiplicity = multiplicity;
00107         return this;
00108     }

Relation getMultRelation (  ) 

Get the multiplicity relation.

Todo:
Provide string-based accessors for Castor

Definition at line 114 of file Particle.java.

Referenced by Particle.hashCode(), and Particle.toString().

00114                                       {
00115         return multRelation;
00116     }

Particle setMultRelation ( Relation  multRelation  ) 

Set the multiplicity relation.

Todo:
Provide string-based accessors for Castor

Definition at line 120 of file Particle.java.

References Particle.multRelation.

Referenced by Particle.Particle().

00120                                                            {
00121         this.multRelation = multRelation;
00122         return this;
00123     }

String getHtmlName (  )  throws HDException

Get HTML version of the particle name, using YaPPI.

Todo:
Make this work!

Definition at line 134 of file Particle.java.

00134                                                    {
00135         throw new HDException("YaPPI functionality currently unimplemented");
00136     }

String getTexName (  )  throws HDException

Get TeX version of the particle name, using YaPPI.

Todo:
Make this work!

Definition at line 142 of file Particle.java.

00142                                                   {
00143         throw new HDException("YaPPI functionality currently unimplemented");
00144     }

boolean equals ( Object  other  ) 

Compare particles for equality.

Definition at line 153 of file Particle.java.

References Particle.hashCode().

00153                                         {
00154         if (this == other) return true;
00155         //if (! (other instanceof Reaction)) return false;
00156         if (! (other instanceof Particle)) return false;
00157         return hashCode() == other.hashCode();
00158     }

int hashCode (  ) 

Specific hashCode.

Definition at line 161 of file Particle.java.

References Particle.getMultiplicity(), Particle.getMultRelation(), and Particle.getPDGCode().

Referenced by Particle.equals().

00161                           {
00162         int code = 37;
00163         if (getPDGCode() != null) code ^= getPDGCode().hashCode();
00164         if (getMultiplicity() != null) code ^= getMultiplicity().hashCode();
00165         if (getMultRelation() != null) code ^= getMultRelation().hashCode();
00166         return code;
00167     }

String toString (  ) 

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

Reimplemented from Storeable.

Definition at line 174 of file Particle.java.

References Particle.getMultiplicity(), Particle.getMultRelation(), and Particle.getName().

00174                              {
00175         StringBuffer s = new StringBuffer();
00176         if (getMultiplicity() != null) {
00177             if (getMultRelation() != Relation.EQUALS) {
00178                 s.append(getMultRelation());
00179                 s.append(getMultiplicity());
00180             } else if (getMultiplicity() != 1) {
00181                 s.append(getMultiplicity());
00182             }
00183         }
00184         s.append(getName());
00185         return s.toString();
00186     }

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