Class Element

    • Field Detail

      • atomicNumber

        protected Integer atomicNumber
        The atomic number for this element giving their position in the periodic table.
    • Constructor Detail

      • Element

        public Element()
        Constructs an empty Element.
      • Element

        public Element​(IElement 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

        public Element​(String symbol)
        Constructs an Element with a given element symbol.
        Parameters:
        symbol - The element symbol that this element should have.
      • Element

        public Element​(String symbol,
                       Integer atomicNumber)
        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 Detail

      • getAtomicNumber

        public Integer 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 interface IElement
        Returns:
        The atomic number of this element
        See Also:
        setAtomicNumber(java.lang.Integer)
      • setAtomicNumber

        public void setAtomicNumber​(Integer atomicNumber)
        Sets the atomic number of this element.
        Specified by:
        setAtomicNumber in interface IElement
        Parameters:
        atomicNumber - The atomic mass to be assigned to this element
        See Also:
        getAtomicNumber()
      • setSymbol

        public void setSymbol​(String symbol)
        Sets the element symbol of this element.
        Specified by:
        setSymbol in interface IElement
        Parameters:
        symbol - The element symbol to be assigned to this atom
        See Also:
        getSymbol()
      • toString

        public String toString()
        Description copied from interface: IChemObject
        Returns a one line description of this IChemObject.
        Specified by:
        toString in interface IChemObject
        Overrides:
        toString in class Object
        Returns:
        a String representation of this object
      • compare

        public boolean compare​(Object object)
        Compares an Element with this Element.
        Overrides:
        compare in class ChemObject
        Parameters:
        object - Object of type AtomType
        Returns:
        true if the atom types are equal