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 17 of file Particle.java.
Particle | ( | ) |
Particle | ( | Integer | pdgCode | ) |
Definition at line 42 of file Particle.java.
References Particle.setPDGCode().
00042 { 00043 setPDGCode(pdgCode); 00044 }
Particle | ( | String | name | ) |
Definition at line 46 of file Particle.java.
References Particle.setName().
00046 { 00047 setName(name); 00048 }
Particle | ( | String | name, | |
Integer | multiplicity | |||
) |
Definition at line 50 of file Particle.java.
References Particle.setMultiplicity().
00050 { 00051 this(name); 00052 setMultiplicity(multiplicity); 00053 }
Definition at line 55 of file Particle.java.
References Particle.setMultRelation().
00055 { 00056 this(name, multiplicity); 00057 setMultRelation(relation); 00058 }
Definition at line 65 of file Particle.java.
References Particle.getName(), and Particle.getPDGCode().
00065 { 00066 return a.getPDGCode() != null && b.getPDGCode() != null && a.getPDGCode() == b.getPDGCode() 00067 || 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().
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.hashCode(), 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 Particle)) return false; 00156 return hashCode() == other.hashCode(); 00157 }
int hashCode | ( | ) |
Specific hashCode.
Definition at line 161 of file Particle.java.
References Particle.getMultiplicity(), Particle.getMultRelation(), Particle.getName(), and Particle.getPDGCode().
Referenced by Particle.equals().
00161 { 00162 int code = 37; 00163 if (getName() != null) code ^= getName().hashCode(); 00164 if (getPDGCode() != null) code ^= getPDGCode().hashCode(); 00165 if (getMultiplicity() != null) code ^= getMultiplicity().hashCode(); 00166 if (getMultRelation() != null) code ^= getMultRelation().hashCode(); 00167 return code; 00168 }
String toString | ( | ) |
Default String representation: declares that method is not properly defined by default.
Reimplemented from Storeable.
Definition at line 175 of file Particle.java.
References Particle.getMultiplicity(), Particle.getMultRelation(), and Particle.getName().
00175 { 00176 StringBuffer s = new StringBuffer(); 00177 if (getMultiplicity() != null) { 00178 if (getMultRelation() != null && getMultRelation() != Relation.EQUALS) { 00179 s.append(getMultRelation()); 00180 s.append(getMultiplicity()); 00181 } else if (getMultiplicity() != 1) { 00182 s.append(getMultiplicity()); 00183 } 00184 } 00185 s.append(getName()); 00186 return s.toString(); 00187 }
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().