Purpose: An immutable encapsulation of an atom.
atomicNumber
- An int
containing the
atomic number (i.e., the number of protons)massNumber
- An int
containing
the mass number (i.e., the number of protons and neutrons)symbol
- A String
containing the symbol/** * Explicit Value Constructor * * @param symbol The chemical symbol * @param atomicNumber The atomic number (number of protons) * @param massNumber The mass number (number of protons and neutrons) */ public Atom(String symbol, int atomicNumber, int massNumber) { }
/** * Determine if this Atom is identical to another Atom (i.e., the * two have the same number of protons and neutrons) * * @param other The other Atom * @return true if this and other are identical */ public boolean equals(Atom other) { }
public int getAtomicNumber() public int getElectrons() public int getMassNumber() public int getNeutrons() public int getProtons()
/** * Get a String representation of this Atom. * The String representation can be either verbose (i.e., can include * the mass number) or terse. * * @param verbose true to get a verbose version * @return The String */ public String toString(boolean verbose) { }
/** * Get the normal/default String representation of this Atom. * * @return The String */ public String toString() { }
This method must call the toString(boolean)
method.
Copyright 2013