/** * A data model for an element. * @author Paul Gestwicki */ public class Element { /** * The name of an element. This is the element's full name, * such as oxygen or lithium. */ private String name; /** * The abbreviation for an element. This is the official abbreviation * as would appear in a periodic table. For example, the abbreviation * for Oxygen is O. */ private String abbreviation; /** * The atomic number of the element. This is the number of protons * contained in an atom's nucleus. */ private int atomicNumber; /** * Public element constructor. * @param name the name of the element * @param abbreviation the element's official abbreviation * @param number the element's atomic number */ public Element(String name, String abbreviation, int number) { this.name = name; this.abbreviation = abbreviation; this.atomicNumber = number; } /** * Get the element's abbreviation. * @return element abbreviation * @see #abbreviation */ public String getAbbreviation() { return abbreviation; } /** * Get the element's atomic number. * @return atomic number * @see #atomicNumber */ public int getAtomicNumber() { return atomicNumber; } /** * Get the name of the element as a string. * @return element's name * @see #name */ public String getName() { return name; } }