public class Element extends ChemObject implements Serializable, IElement, Cloneable
Use the IsotopeFactory to get a ready-to-use elements by symbol or atomic number:
IsotopeFactory if = IsotopeFactory.getInstance(new Element().getNewBuilder());
Element e1 = if.getElement("C");
Element e2 = if.getElement(12);
XMLIsotopeFactory,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Integer |
atomicNumber
The atomic number for this element giving their position in the periodic table.
|
Ac, Ag, Al, Am, Ar, As, At, Au, B, Ba, Be, Bh, Bi, Bk, Br, C, Ca, Cd, Ce, Cf, Cl, Cm, Cn, Co, Cr, Cs, Cu, Db, Ds, Dy, Er, Es, Eu, F, Fe, Fl, Fm, Fr, Ga, Gd, Ge, H, He, Hf, Hg, Ho, Hs, I, In, Ir, K, Kr, La, Li, Lr, Lu, Lv, Mc, Md, Mg, Mn, Mo, Mt, N, Na, Nb, Nd, Ne, Nh, Ni, No, Np, O, Og, Os, P, Pa, Pb, Pd, Pm, Po, Pr, Pt, Pu, Ra, Rb, Re, Rf, Rg, Rh, Rn, Ru, S, Sb, Sc, Se, Sg, Si, Sm, Sn, Sr, Ta, Tb, Tc, Te, Th, Ti, Tl, Tm, Ts, U, V, W, Wildcard, Xe, Y, Yb, Zn, Zr| Constructor and Description |
|---|
Element()
Constructs an empty Element.
|
Element(IElement element)
Constructs an empty by copying the symbol, atomic number,
flags, and identifier from the given IElement.
|
Element(String symbol)
Constructs an Element with a given
element symbol.
|
Element(String symbol,
Integer atomicNumber)
Constructs an Element with a given element symbol,
atomic number and atomic mass.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clones this
IChemObject. |
boolean |
compare(Object object)
Compares an Element with this Element.
|
Integer |
getAtomicNumber()
Returns the atomic number of this element.
|
String |
getSymbol()
Returns the element symbol of this element.
|
void |
setAtomicNumber(Integer atomicNumber)
Sets the atomic number of this element.
|
void |
setSymbol(String symbol)
Sets the element symbol of this element.
|
String |
toString()
Returns a one line description of this IChemObject.
|
addListener, addProperties, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopyequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setPropertygetBuilderprotected Integer atomicNumber
public Element()
public Element(IElement element)
element - IElement to copy information frompublic Element(String symbol)
symbol - The element symbol that this element should have.public Integer getAtomicNumber()
Once instantiated all field not filled by passing parameters to the constructor are null. Elements can be configured by using the IsotopeFactory.configure() method:
Element element = new Element("C");
IsotopeFactory if = IsotopeFactory.getInstance(element.getNewBuilder());
if.configure(element);
getAtomicNumber in interface IElementsetAtomicNumber(java.lang.Integer)public void setAtomicNumber(Integer atomicNumber)
setAtomicNumber in interface IElementatomicNumber - The atomic mass to be assigned to this elementgetAtomicNumber()public String getSymbol()
getSymbol in interface IElementsetSymbol(java.lang.String)public void setSymbol(String symbol)
setSymbol in interface IElementsymbol - The element symbol to be assigned to this atomgetSymbol()public String toString()
IChemObjecttoString in interface IChemObjecttoString in class Objectpublic Object clone() throws CloneNotSupportedException
ChemObjectIChemObject. It clones the identifier, flags,
properties and pointer vectors. The ChemObjectListeners are not cloned, and
neither is the content of the pointer vectors.clone in interface IChemObjectclone in class ChemObjectCloneNotSupportedException - if the IChemObject cannot be clonedpublic boolean compare(Object object)
compare in class ChemObjectobject - Object of type AtomTypeCopyright © 2022. All rights reserved.