public class Element extends Object { //List of instance variables accesible in the Element public int A = 0; public int Z = 0; public double cohXS, incohXS, scatXS, absXS, mass, naturalConc; public double realCohB, imCohB, realInCohB, imInCohB; public double CrKafp, CrKafpp; public double FeKafp, FeKafpp; public double CuKafp, CuKafpp; public double MoKafp, MoKafpp; public double AgKafp, AgKafpp; /** * Public constructor for the isotope in which the number * and the total number of nucleons can be specified. * The input is not actually Z, the atomic number, since D for * deuterium is used as the second element in the database, so * that is why it is called inNumber instead of inZ */ public Element(int inNumber, int inA) { setData(inNumber, inA); } /** * This method is only used by the Element constructor. * It reads all of the data from the ElementData class and * sets all of the instance variables in this Element object. * It sets the correct value for the isotopes atomic number, Z, * by reading from the elementZ variable in the ElementData class. */ public void setData(int inNumber, int inA) { double[] parameters = ElementData.getData(inNumber, inA); naturalConc = parameters[0]; realCohB = parameters[1]; imCohB = parameters[2]; realInCohB = parameters[3]; imInCohB = parameters[4]; cohXS = parameters[5]; incohXS = parameters[6]; scatXS = parameters[7]; absXS = parameters[8]; mass = parameters[9]; CrKafp = parameters[10]; CrKafpp = parameters[11]; FeKafp = parameters[12]; FeKafpp = parameters[13]; CuKafp = parameters[14]; CuKafpp = parameters[15]; MoKafp = parameters[16]; MoKafpp = parameters[17]; AgKafp = parameters[18]; AgKafpp = parameters[19]; A = inA; Z = ElementData.elementZ[inNumber-1]; } /** * * If an element is no good, or there is no data for the isotope in * the table of data a check is performed on the mass. If that check * yields a mass of NaN (not a number) Then the element is marked * as bad when this method is called. * */ public boolean isBad() { boolean badone = false; if(Double.isNaN(mass)) badone = true; return badone; } }