public static void initPeriodicTable() { if (DIAGNOSTICS) { System.out.println("in initPeriodicTable"); } for (int anum = 0; anum < symbolAr.length; anum++) { Element element = new Element(); element.atomicNumber = anum; element.atomicWeight = atomicWeightAr[anum]; element.symbol = symbolAr[anum]; element.group = groupAr[anum]; element.period = periodAr[anum]; element.valence = valenceAr[anum]; elementAr[anum] = element; } }
private static void dumpElement(Element element) { if (DIAGNOSTICS) { System.out.println("In dumpElement."); } if (element != null) { System.out.println(" symbol: " + element.getSymbol()); System.out.println(" atomic number: " + element.getAtomicNumber()); System.out.println(" valence: " + element.getValence()); System.out.println(" atomic weight: " + element.getAtomicWeight()); System.out.println(" period: " + element.getPeriod()); System.out.println(" group: " + element.getGroup()); } System.out.println(); }
public boolean equals(Element element) { return getAtomicNumber() == element.getAtomicNumber(); }