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. |
A particle in this sense also encodes the multiplicity of the particle in the reaction, possibly with an inequality on the multiplicity relation.
Definition at line 18 of file Particle.java.
Particle | ( | ) |
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 }
Definition at line 56 of file Particle.java.
References Particle.setMultRelation().
00056 { 00057 this(name, multiplicity); 00058 setMultRelation(relation); 00059 }
Definition at line 66 of file Particle.java.
References Particle.getName(), and Particle.getPDGCode().
Integer getPDGCode | ( | ) |
Get PDG code.
Definition at line 75 of file Particle.java.
Referenced by Particle.hashCode(), and Particle.sameType().
Particle setPDGCode | ( | Integer | pdgCode | ) |
Set PDG code.
Definition at line 79 of file Particle.java.
References Particle.pdgCode.
Referenced by Particle.Particle().
String getName | ( | ) |
Get particle name.
Definition at line 88 of file Particle.java.
Referenced by Particle.sameType(), and Particle.toString().
Particle setName | ( | String | name | ) |
Set particle name.
Definition at line 94 of file Particle.java.
References Particle.name.
Referenced by Particle.Particle().
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().
Particle setMultiplicity | ( | Integer | multiplicity | ) |
Set multiplicity.
Definition at line 105 of file Particle.java.
References Particle.multiplicity.
Referenced by Particle.Particle().
Relation getMultRelation | ( | ) |
Get the multiplicity relation.
Definition at line 114 of file Particle.java.
Referenced by Particle.hashCode(), and Particle.toString().
Set the multiplicity relation.
Definition at line 120 of file Particle.java.
References Particle.multRelation.
Referenced by Particle.Particle().
String getHtmlName | ( | ) | throws HDException |
Get HTML version of the particle name, using YaPPI.
Definition at line 134 of file Particle.java.
String getTexName | ( | ) | throws HDException |
Get TeX version of the particle name, using YaPPI.
Definition at line 142 of file Particle.java.
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().