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 FormModifier and Type | Field and Description |
---|---|
protected Integer |
atomicNumber
The atomic number for this element giving their position in the periodic table.
|
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, shallowCopy
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
getBuilder
protected 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 IElement
setAtomicNumber(java.lang.Integer)
public void setAtomicNumber(Integer atomicNumber)
setAtomicNumber
in interface IElement
atomicNumber
- The atomic mass to be assigned to this elementgetAtomicNumber()
public String getSymbol()
getSymbol
in interface IElement
setSymbol(java.lang.String)
public void setSymbol(String symbol)
setSymbol
in interface IElement
symbol
- The element symbol to be assigned to this atomgetSymbol()
public String toString()
IChemObject
toString
in interface IChemObject
toString
in class Object
public Object clone() throws CloneNotSupportedException
ChemObject
IChemObject
. 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 IChemObject
clone
in class ChemObject
CloneNotSupportedException
- if the IChemObject cannot be clonedpublic boolean compare(Object object)
compare
in class ChemObject
object
- Object of type AtomTypeCopyright © 2018. All Rights Reserved.