Package org.openscience.cdk.silent
Class Element
java.lang.Object
org.openscience.cdk.silent.ChemObject
org.openscience.cdk.silent.Element
- All Implemented Interfaces:
Serializable
,Cloneable
,ICDKObject
,IChemObject
,IElement
- Direct Known Subclasses:
Isotope
Implements the idea of an element in the periodic table.
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);
- See Also:
- Source code:
- main
- Belongs to CDK module:
- silent
- Keywords:
- element
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Integer
The atomic number for this element giving their position in the periodic table.Fields inherited from interface org.openscience.cdk.interfaces.IElement
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 Summary
ConstructorsConstructorDescriptionElement()
Constructs an empty Element.Constructs an Element with a given element symbol.Constructs an Element with a given element symbol, atomic number and atomic mass.Constructs an empty by copying the symbol, atomic number, flags, and identifier from the given IElement. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones thisIChemObject
.boolean
Compares an Element with this Element.Returns the atomic number of this element.Returns the element symbol of this element.void
setAtomicNumber
(Integer atomicNumber) Sets the atomic number of this element.void
Sets the element symbol of this element.toString()
Returns a one line description of this IChemObject.Methods inherited from class org.openscience.cdk.silent.ChemObject
addListener, addProperties, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
Field Details
-
atomicNumber
The atomic number for this element giving their position in the periodic table.
-
-
Constructor Details
-
Element
public Element()Constructs an empty Element. -
Element
Constructs an empty by copying the symbol, atomic number, flags, and identifier from the given IElement. It does not copy the listeners and properties.- Parameters:
element
- IElement to copy information from
-
Element
Constructs an Element with a given element symbol.- Parameters:
symbol
- The element symbol that this element should have.
-
Element
Constructs an Element with a given element symbol, atomic number and atomic mass.- Parameters:
symbol
- The element symbol of this element.atomicNumber
- The atomicNumber of this element.
-
-
Method Details
-
getAtomicNumber
Returns the atomic number of this element.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);
- Specified by:
getAtomicNumber
in interfaceIElement
- Returns:
- The atomic number of this element
- See Also:
-
setAtomicNumber
Sets the atomic number of this element.- Specified by:
setAtomicNumber
in interfaceIElement
- Parameters:
atomicNumber
- The atomic mass to be assigned to this element- See Also:
-
getSymbol
Returns the element symbol of this element. -
setSymbol
Sets the element symbol of this element. -
toString
Description copied from interface:IChemObject
Returns a one line description of this IChemObject.- Specified by:
toString
in interfaceIChemObject
- Overrides:
toString
in classObject
- Returns:
- a String representation of this object
-
clone
Description copied from class:ChemObject
Clones thisIChemObject
. It clones the identifier, flags, properties and pointer vectors. The ChemObjectListeners are not cloned, and neither is the content of the pointer vectors.- Specified by:
clone
in interfaceIChemObject
- Overrides:
clone
in classChemObject
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
compare
Compares an Element with this Element.- Overrides:
compare
in classChemObject
- Parameters:
object
- Object of type AtomType- Returns:
- true if the atom types are equal
-