001: package JSci.chemistry;
002:
003: /**
004: * A class representing chemical elements.
005: * To obtain an instance of Element, use the {@link PeriodicTable#getElement(String) PeriodicTable.getElement} method.
006: * @version 1.6
007: * @author Mark Hale
008: */
009: public class Element extends Object implements java.io.Serializable {
010: private String name;
011: private String symbol;
012: private int atomicNumber;
013: private int massNumber;
014: private double electronegativity;
015: private double covalentRadius;
016: private double atomicRadius;
017: private double meltingPoint;
018: private double boilingPoint;
019: private double density;
020: private double specificHeat;
021: private double electricalConductivity;
022: private double thermalConductivity;
023:
024: /**
025: * Constructs an element.
026: * @param title name of element.
027: * @param label symbol for element.
028: */
029: public Element(String title, String label) {
030: name = title;
031: symbol = label;
032: }
033:
034: /**
035: * Returns the name.
036: */
037: public String getName() {
038: return name;
039: }
040:
041: /**
042: * Returns the atomic number.
043: */
044: public int getAtomicNumber() {
045: return atomicNumber;
046: }
047:
048: protected void setAtomicNumber(int z) {
049: atomicNumber = z;
050: }
051:
052: /**
053: * Returns the mass number.
054: */
055: public int getMassNumber() {
056: return massNumber;
057: }
058:
059: protected void setMassNumber(int m) {
060: massNumber = m;
061: }
062:
063: /**
064: * Returns the electronegativity.
065: */
066: public double getElectronegativity() {
067: return electronegativity;
068: }
069:
070: protected void setElectronegativity(double en) {
071: electronegativity = en;
072: }
073:
074: /**
075: * Returns the covalent radius.
076: */
077: public double getCovalentRadius() {
078: return covalentRadius;
079: }
080:
081: protected void setCovalentRadius(double covRadius) {
082: covalentRadius = covRadius;
083: }
084:
085: /**
086: * Returns the atomic radius.
087: */
088: public double getAtomicRadius() {
089: return atomicRadius;
090: }
091:
092: protected void setAtomicRadius(double atomRadius) {
093: atomicRadius = atomRadius;
094: }
095:
096: /**
097: * Returns the melting point (K).
098: */
099: public double getMeltingPoint() {
100: return meltingPoint;
101: }
102:
103: protected void setMeltingPoint(double melt) {
104: meltingPoint = melt;
105: }
106:
107: /**
108: * Returns the boiling point (K).
109: */
110: public double getBoilingPoint() {
111: return boilingPoint;
112: }
113:
114: protected void setBoilingPoint(double boil) {
115: boilingPoint = boil;
116: }
117:
118: /**
119: * Returns the density (293K).
120: */
121: public double getDensity() {
122: return density;
123: }
124:
125: protected void setDensity(double rho) {
126: density = rho;
127: }
128:
129: /**
130: * Returns the specific heat.
131: */
132: public double getSpecificHeat() {
133: return specificHeat;
134: }
135:
136: protected void setSpecificHeat(double heat) {
137: specificHeat = heat;
138: }
139:
140: /**
141: * Returns the electrical conductivity.
142: */
143: public double getElectricalConductivity() {
144: return electricalConductivity;
145: }
146:
147: protected void setElectricalConductivity(double elect) {
148: electricalConductivity = elect;
149: }
150:
151: /**
152: * Returns the thermal conductivity.
153: */
154: public double getThermalConductivity() {
155: return thermalConductivity;
156: }
157:
158: protected void setThermalConductivity(double therm) {
159: thermalConductivity = therm;
160: }
161:
162: /**
163: * Compares two elements for equality.
164: * @param e an element.
165: */
166: public boolean equals(Object e) {
167: return (e != null) && (e instanceof Element)
168: && (atomicNumber == ((Element) e).atomicNumber)
169: && (massNumber == ((Element) e).massNumber);
170: }
171:
172: public int hashCode() {
173: return 37 * (37 * (37 * 17 + atomicNumber) + massNumber);
174: }
175:
176: /**
177: * Returns the chemical symbol.
178: */
179: public String toString() {
180: return symbol;
181: }
182: }
|