Package org.openscience.cdk
Class Element
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.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:
-
org.openscience.cdk.config.XMLIsotopeFactory- Serialized Form
- Keywords:
- element
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IntegerThe atomic number for this element giving their position in the periodic table.Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, MARKUSH, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITEDFields 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.booleanCompares an Element with this Element.Returns the atomic number of this element.Returns the element symbol of this element.voidsetAtomicNumber(Integer atomicNumber) Sets the atomic number of this element.voidSets the element symbol of this element.toString()Methods inherited from class org.openscience.cdk.ChemObject
addListener, addProperties, clear, flags, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopyMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilderMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, clear, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, 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:
getAtomicNumberin interfaceIElement- Returns:
- The atomic number of this element
- See Also:
-
setAtomicNumber
Sets the atomic number of this element.- Specified by:
setAtomicNumberin 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
- Specified by:
toStringin interfaceIChemObject- Overrides:
toStringin classObject
-
clone
Description copied from class:ChemObjectClones 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:
clonein interfaceIChemObject- Overrides:
clonein classChemObject- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
-
compare
Compares an Element with this Element.- Overrides:
comparein classChemObject- Parameters:
object- Object of type AtomType- Returns:
- true if the atom types are equal
-