All Downloads are FREE. Search and download functionalities are using the official Maven repository.

JSci.chemistry.Element Maven / Gradle / Ivy

Go to download

JSci is a set of open source Java packages. The aim is to encapsulate scientific methods/principles in the most natural way possible. As such they should greatly aid the development of scientific based software. It offers: abstract math interfaces, linear algebra (support for various matrix and vector types), statistics (including probability distributions), wavelets, newtonian mechanics, chart/graph components (AWT and Swing), MathML DOM implementation, ... Note: some packages, like javax.comm, for the astro and instruments package aren't listed as dependencies (not available).

The newest version!
package JSci.chemistry;

/**
* A class representing chemical elements.
* To obtain an instance of Element, use the {@link PeriodicTable#getElement(String) PeriodicTable.getElement} method.
* @version 1.6
* @author Mark Hale
*/
public class Element extends Object implements java.io.Serializable {
        private String name;
        private String symbol;
        private int atomicNumber;
        private int massNumber;
        private double electronegativity;
        private double covalentRadius;
        private double atomicRadius;
        private double meltingPoint;
        private double boilingPoint;
        private double density;
        private double specificHeat;
        private double electricalConductivity;
        private double thermalConductivity;
        /**
        * Constructs an element.
        * @param title name of element.
        * @param label symbol for element.
        */
        public Element(String title,String label) {
                name=title;
                symbol=label;
        }
        /**
        * Returns the name.
        */
        public String getName() {
                return name;
        }
        /**
        * Returns the atomic number.
        */
        public int getAtomicNumber() {
                return atomicNumber;
        }
        protected void setAtomicNumber(int z) {
                atomicNumber=z;
        }
        /**
        * Returns the mass number.
        */
        public int getMassNumber() {
                return massNumber;
        }
        protected void setMassNumber(int m) {
                massNumber=m;
        }
        /**
        * Returns the electronegativity.
        */
        public double getElectronegativity() {
                return electronegativity;
        }
        protected void setElectronegativity(double en) {
                electronegativity=en;
        }
        /**
        * Returns the covalent radius.
        */
        public double getCovalentRadius() {
                return covalentRadius;
        }
        protected void setCovalentRadius(double covRadius) {
                covalentRadius=covRadius;
        }
        /**
        * Returns the atomic radius.
        */
        public double getAtomicRadius() {
                return atomicRadius;
        }
        protected void setAtomicRadius(double atomRadius) {
                atomicRadius=atomRadius;
        }
        /**
        * Returns the melting point (K).
        */
        public double getMeltingPoint() {
                return meltingPoint;
        }
        protected void setMeltingPoint(double melt) {
                meltingPoint=melt;
        }
        /**
        * Returns the boiling point (K).
        */
        public double getBoilingPoint() {
                return boilingPoint;
        }
        protected void setBoilingPoint(double boil) {
                boilingPoint=boil;
        }
        /**
        * Returns the density (293K).
        */
        public double getDensity() {
                return density;
        }
        protected void setDensity(double rho) {
                density=rho;
        }
        /**
        * Returns the specific heat.
        */
        public double getSpecificHeat() {
                return specificHeat;
        }
        protected void setSpecificHeat(double heat) {
                specificHeat=heat;
        }
        /**
        * Returns the electrical conductivity.
        */
        public double getElectricalConductivity() {
                return electricalConductivity;
        }
        protected void setElectricalConductivity(double elect) {
                electricalConductivity=elect;
        }
        /**
        * Returns the thermal conductivity.
        */
        public double getThermalConductivity() {
                return thermalConductivity;
        }
        protected void setThermalConductivity(double therm) {
                thermalConductivity=therm;
        }
        /**
        * Compares two elements for equality.
        * @param e an element.
        */
        public boolean equals(Object e) {
                return (e!=null) && (e instanceof Element) &&
                        (atomicNumber==((Element)e).atomicNumber) &&
                        (massNumber==((Element)e).massNumber);
        }
	public int hashCode() {
		return 37*(37*(37*17+atomicNumber)+massNumber);
	}
        /**
        * Returns the chemical symbol.
        */
        public String toString() {
                return symbol;
        }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy