001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 * Created on 29.04.2010 021 * 022 */ 023package org.biojava.nbio.structure; 024 025import java.io.Serializable; 026import java.util.HashMap; 027import java.util.Map; 028 029/** 030 * Element is an enumeration of the elements of the periodic table. In addition, 031 * several attributes of each element are accessible. 032 * <B>Note:</B> Deuterium and Tritium are treated as separate elements D and T, 033 * respectively. Sometimes part of a molecule is represented as an R-group, which 034 * is represented as the element R. 035 * 036 * 037 * @author Peter Rose 038 * @version %I% %G% 039 * @since 3.0 040 * 041 */ 042 043public enum Element implements Serializable { 044 045 // most frequently used elements first 046 H(1, 1, 39, 1.10f, 0.32f, 1, 1, 1, 1, 1, 1.008f, 0, 1, new int[] {1}, 2.20f, ElementType.OTHER_NONMETAL), 047 C(6, 2, 0, 1.55f, 0.77f, 4, 4, 4, 4, 4, 12.011f, 2, -4, new int[] {-4,-3,-2,0,-1,1,2,3,4}, 2.55f, ElementType.OTHER_NONMETAL), 048 N(7, 2, 57, 1.40f, 0.75f, 5, 2, 5, 3, 4, 14.007f, 2, -3, new int[] {-3,-2,-1,0,1,2,3,4,5}, 3.04f, ElementType.OTHER_NONMETAL), 049 O(8, 2, 65, 1.35f, 0.73f, 6, 1, 2, 2, 2, 16.000f, 2, -2, new int[] {-2,-1,0,1,2}, 3.44f, ElementType.OTHER_NONMETAL), 050 /** 051 * Deuterium 052 */ 053 D(1, 1, 27, 1.10f, 0.32f, 1, 1, 1, 1, 1, 1.008f, 0, 1, new int[] {0,1}, 2.20f, ElementType.OTHER_NONMETAL), // need to edit properties! 054 /** 055 * Tritium 056 */ 057 T(1, 1, 90, 1.10f, 0.32f, 1, 1, 1, 1, 1, 1.008f, 0, 1, new int[] {0,1}, 2.20f, ElementType.OTHER_NONMETAL), // need to edit properties! 058 He(2, 1, 40, 2.20f, 1.60f, 2, 0, 12, 0, 0, 4.003f, 2, 0, new int[] {0}, 0.0f, ElementType.NOBLE_GAS), // electroneg not reported 059 Li(3, 2, 50, 1.22f, 1.34f, 1, 0, 12, 0, 1, 6.940f, 2, 1, new int[] {0,1}, 0.98f, ElementType.ALKALI_METAL), 060 Be(4, 2, 12, 0.63f, 0.90f, 2, 0, 12, 2, 2, 9.012f, 2, 2, new int[] {0,1,2}, 1.57f, ElementType.TRANSITION_METAL), 061 B(5, 2, 10, 1.55f, 0.82f, 3, 3, 5, 3, 4, 10.810f, 2, 3, new int[] {0,1,2,3}, 2.04f, ElementType.METALLOID), 062 F(9, 2, 32, 1.30f, 0.72f, 7, 0, 1, 1, 1, 18.998f, 2, -1, new int[] {-1,0,1}, 3.98f, ElementType.HALOGEN), 063 Ne(10, 2, 61, 2.02f, 1.12f, 8, 0, 12, 0, 0, 20.170f, 10, 0, new int[] {}, 0.00f, ElementType.NOBLE_GAS), // electroneg not reported 064 Na(11, 3, 58, 2.20f, 1.54f, 1, 0, 1, 0, 0, 22.990f, 10, 1, new int[] {-1,0,1}, 0.93f, ElementType.ALKALI_METAL), 065 Mg(12, 3, 54, 1.50f, 1.30f, 2, 0, 2, 0, 2, 24.305f, 10, 2, new int[] {0,1,2}, 1.31f, ElementType.ALKALINE_EARTH_METAL), 066 Al(13, 3, 4, 1.50f, 1.18f, 3, 0, 5, 0, 4, 26.982f, 10, 3, new int[] {0,1,2,3}, 1.61f, ElementType.POST_TRANSITION_METAL), 067 Si(14, 3, 86, 2.20f, 1.11f, 4, 4, 4, 4, 4, 28.086f, 10, 4, new int[] {-4,-3,-2,-1,0,1,2,3,4}, 1.90f, ElementType.METALLOID), 068 P(15, 3, 67, 1.88f, 1.06f, 5, 3, 5, 3, 5, 30.974f, 10, 5, new int[] {-3,-2,-1,0,1,2,3,4,5}, 2.19f, ElementType.OTHER_NONMETAL), 069 S(16, 3, 82, 1.81f, 1.02f, 6, 2, 6, 2, 6, 32.060f, 10, -2, new int[] {-2,-1,0,1,2,3,4,5,6}, 2.58f, ElementType.OTHER_NONMETAL), 070 Cl(17, 3, 21, 1.75f, 0.99f, 7, 0, 1, 1, 1, 35.453f, 10, -1, new int[] {-1,0,1,2,3,4,5,6,7}, 3.16f, ElementType.HALOGEN), 071 Ar(18, 4, 6, 2.77f, 1.54f, 8, 0, 12, 0, 0, 39.948f, 18, 0, new int[] {0}, 0.00f, ElementType.NOBLE_GAS), // electroneg not reported 072 K(19, 4, 47, 2.39f, 1.96f, 1, 0, 12, 0, 0, 39.102f, 18, 1, new int[] {-1,0,1}, 0.82f, ElementType.ALKALI_METAL), 073 Ca(20, 4, 17, 1.95f, 1.74f, 2, 0, 2, 0, 0, 40.080f, 18, 2, new int[] {0,1,2}, 1.00f, ElementType.ALKALINE_EARTH_METAL), 074 Sc(21, 4, 84, 1.32f, 1.44f, 3, 0, 12, 3, 0, 44.956f, 18, 3, new int[] {0,1,2,3}, 1.36f, ElementType.TRANSITION_METAL), 075 Ti(22, 4, 96, 1.95f, 1.36f, 4, 2, 4, 3, 4, 47.880f, 18, 4, new int[] {-1,0,1,2,3,4}, 1.54f, ElementType.TRANSITION_METAL), 076 V(23, 4, 100, 1.06f, 1.25f, 5, 0, 12, 3, 0, 50.040f, 18, 5, new int[] {-1,0,1,2,3,4,5}, 1.63f, ElementType.TRANSITION_METAL), 077 Cr(24, 4, 24, 1.13f, 1.27f, 6, 0, 12, 2, 0, 51.996f, 18, 3, new int[] {-2,-1,0,1,2,3,4,5,6}, 1.66f, ElementType.TRANSITION_METAL), 078 Mn(25, 4, 55, 1.19f, 1.39f, 7, 0, 12, 0, 0, 54.938f, 18, 2, new int[] {-3,-2,-1,0,1,2,3,4,5,6,7}, 1.55f, ElementType.TRANSITION_METAL), 079 Fe(26, 4, 33, 1.95f, 1.25f, 3, 0, 8, 0, 0, 55.847f, 18, 3, new int[] {-2,-1,0,1,2,3,4,5,6}, 1.83f, ElementType.TRANSITION_METAL), 080 Co(27, 4, 23, 1.13f, 1.26f, 3, 0, 12, 0, 0, 58.933f, 18, 2, new int[] {-1,0,1,2,3,4,5}, 1.88f, ElementType.TRANSITION_METAL), 081 Ni(28, 4, 62, 1.24f, 1.21f, 3, 0, 12, 0, 0, 58.710f, 18, 2, new int[] {-1,0,1,2,3,4}, 1.91f, ElementType.TRANSITION_METAL), 082 Cu(29, 4, 26, 1.15f, 1.38f, 2, 0, 4, 0, 0, 63.546f, 18, 2, new int[] {0,1,2,3,4}, 1.90f, ElementType.TRANSITION_METAL), 083 Zn(30, 4, 106, 1.15f, 1.31f, 2, 0, 2, 0, 0, 65.380f, 18, 2, new int[] {0,1,2}, 1.65f, ElementType.TRANSITION_METAL), 084 Ga(31, 4, 36, 1.55f, 1.26f, 3, 1, 4, 2, 4, 69.720f, 28, 3, new int[] {0,1,2,3}, 1.81f, ElementType.POST_TRANSITION_METAL), 085 Ge(32, 4, 38, 2.72f, 1.22f, 4, 0, 12, 4, 4, 72.590f, 28, 4, new int[] {-4,-3,-2,-1,0,1,2,3,4}, 2.01f, ElementType.METALLOID), 086 As(33, 4, 7, 0.83f, 1.19f, 5, 0, 12, 3, 5, 74.922f, 28, -3, new int[] {-3,0,1,2,3,5}, 2.18f, ElementType.METALLOID), 087 Se(34, 4, 85, 0.90f, 1.16f, 6, 0, 12, 2, 6, 78.960f, 28, 4, new int[] {-2,0,1,2,4,6}, 2.55f, ElementType.OTHER_NONMETAL), 088 Br(35, 4, 15, 1.95f, 1.14f, 7, 0, 1, 1, 1, 79.904f, 28, -1, new int[] {-1,0,1,2,3,4,5,7}, 2.96f, ElementType.HALOGEN), 089 Kr(36, 4, 48, 1.90f, 1.60f, 8, 0, 12, 0, 0, 83.800f, 28, 0, new int[] {0,2}, 3.00f, ElementType.NOBLE_GAS), 090 Rb(37, 5, 77, 2.65f, 2.11f, 1, 0, 12, 0, 0, 85.467f, 36, 1, new int[] {-1,0,1}, 0.82f, ElementType.ALKALI_METAL), 091 Sr(38, 5, 89, 2.02f, 1.92f, 2, 0, 12, 2, 0, 87.620f, 36, 2, new int[] {0,1,2}, 0.95f, ElementType.ALKALINE_EARTH_METAL), 092 Y(39, 5, 103, 1.61f, 1.62f, 3, 0, 12, 3, 0, 88.806f, 36, 3, new int[] {0,1,2,3}, 1.22f, ElementType.TRANSITION_METAL), 093 Zr(40, 5, 105, 1.42f, 1.48f, 4, 0, 12, 4, 0, 91.220f, 36, 4, new int[] {0,1,2,3,4}, 1.33f, ElementType.TRANSITION_METAL), 094 Nb(41, 5, 59, 1.33f, 1.37f, 5, 0, 12, 3, 0, 92.906f, 36, 5, new int[] {-1,0,1,2,3,4,5}, 1.60f, ElementType.TRANSITION_METAL), 095 Mo(42, 5, 56, 1.75f, 1.45f, 6, 1, 6, 3, 0, 95.940f, 36, 6, new int[] {-2,-1,0,1,2,3,4,5,6}, 2.16f, ElementType.TRANSITION_METAL), 096 Tc(43, 5, 93, 1.80f, 1.56f, 7, 0, 12, 6, 0, 98.910f, 36, 7, new int[] {-3,-1,0,1,2,3,4,5,6,7}, 1.90f, ElementType.TRANSITION_METAL), 097 Ru(44, 5, 81, 1.20f, 1.26f, 8, 0, 12, 3, 0, 101.070f, 36, 4, new int[] {-2,0,1,2,3,4,5,6,7,8}, 2.20f, ElementType.TRANSITION_METAL), 098 Rh(45, 5, 79, 1.22f, 1.35f, 4, 0, 12, 3, 0, 102.906f, 36, 3, new int[] {-1,0,1,2,3,4,5,6}, 2.28f, ElementType.TRANSITION_METAL), 099 Pd(46, 5, 70, 1.44f, 1.31f, 4, 0, 12, 2, 0, 106.400f, 36, 2, new int[] {0,1,2,4}, 2.20f, ElementType.TRANSITION_METAL), 100 Ag(47, 5, 3, 1.55f, 1.53f, 1, 0, 6, 0, 0, 107.868f, 36, 1, new int[] {0,1,2,3,4}, 1.93f, ElementType.TRANSITION_METAL), 101 Cd(48, 5, 18, 1.75f, 1.48f, 2, 0, 12, 0, 0, 112.400f, 36, 2, new int[] {0,1,2}, 1.69f, ElementType.TRANSITION_METAL), 102 In(49, 5, 45, 1.46f, 1.44f, 3, 0, 12, 3, 0, 114.820f, 46, 3, new int[] {0,1,2,3}, 1.78f, ElementType.POST_TRANSITION_METAL), 103 Sn(50, 5, 88, 1.67f, 1.41f, 4, 0, 12, 2, 4, 118.690f, 46, 4, new int[] {-4,0,2,4}, 1.96f, ElementType.POST_TRANSITION_METAL), 104 Sb(51, 5, 83, 1.12f, 1.38f, 5, 0, 12, 4, 5, 121.750f, 46, -3, new int[] {-3,0,3,5}, 2.05f, ElementType.METALLOID), 105 Te(52, 5, 94, 1.26f, 1.35f, 6, 0, 12, 2, 6, 127.600f, 46, 4, new int[] {-2,0,2,4,5,6}, 2.10f, ElementType.METALLOID), 106 I(53, 5, 44, 2.15f, 1.33f, 7, 1, 1, 1, 1, 126.905f, 46, -1, new int[] {-1,0,1,3,4,5,7}, 2.66f, ElementType.HALOGEN), 107 Xe(54, 5, 102, 2.10f, 1.70f, 8, 0, 12, 0, 0, 131.300f, 46, 0, new int[] {0,1,2,4,6,8}, 2.60f, ElementType.NOBLE_GAS), 108 Cs(55, 6, 25, 3.01f, 2.25f, 1, 0, 12, 0, 0, 132.905f, 54, 1, new int[] {-1,0,1}, 0.79f, ElementType.ALKALI_METAL), 109 Ba(56, 6, 11, 2.41f, 1.98f, 2, 0, 12, 0, 0, 137.340f, 54, 2, new int[] {0,2}, 0.89f, ElementType.ALKALINE_EARTH_METAL), 110 La(57, 6, 49, 1.83f, 1.95f, 3, 0, 12, 3, 0, 138.905f, 54, 3, new int[] {0,2,3}, 1.10f, ElementType.LANTHANOID), 111 Ce(58, 6, 19, 1.86f, 1.03f, 4, 0, 12, 3, 0, 140.120f, 54, 3, new int[] {0,2,3,4}, 1.12f, ElementType.LANTHANOID), 112 Pr(59, 6, 73, 1.62f, 0.90f, 4, 0, 12, 3, 0, 140.908f, 55, 3, new int[] {0,2,3,4}, 1.13f, ElementType.LANTHANOID), 113 Nd(60, 6, 60, 1.79f, 0.99f, 3, 0, 12, 3, 0, 144.240f, 56, 3, new int[] {0,2,3,4}, 1.14f, ElementType.LANTHANOID), 114 Pm(61, 6, 71, 1.76f, 0.98f, 3, 0, 12, 3, 0, 145.000f, 58, 3, new int[] {0,2,3}, 1.13f, ElementType.LANTHANOID), 115 Sm(62, 6, 87, 1.74f, 0.96f, 3, 0, 12, 2, 0, 150.400f, 59, 3, new int[] {0,2,3}, 1.17f, ElementType.LANTHANOID), 116 Eu(63, 6, 31, 1.96f, 1.09f, 3, 0, 12, 2, 0, 151.960f, 60, 3, new int[] {0,2,3}, 1.20f, ElementType.LANTHANOID), 117 Gd(64, 6, 37, 1.69f, 0.94f, 3, 0, 12, 3, 0, 157.250f, 61, 3, new int[] {0,1,2,3}, 1.20f, ElementType.LANTHANOID), 118 Tb(65, 6, 92, 1.66f, 0.92f, 4, 0, 12, 3, 0, 158.925f, 61, 3, new int[] {0,1,2,3,4}, 1.10f, ElementType.LANTHANOID), 119 Dy(66, 6, 28, 1.63f, 0.91f, 3, 0, 12, 3, 0, 162.500f, 62, 3, new int[] {0,2,3,4}, 1.22f, ElementType.LANTHANOID), 120 Ho(67, 6, 43, 1.61f, 0.89f, 3, 0, 12, 3, 0, 164.930f, 64, 3, new int[] {0,2,3}, 1.23f, ElementType.LANTHANOID), 121 Er(68, 6, 29, 1.59f, 0.88f, 3, 0, 12, 3, 0, 167.260f, 65, 3, new int[] {0,2,3}, 1.24f, ElementType.LANTHANOID), 122 Tm(69, 6, 98, 1.57f, 0.87f, 3, 0, 12, 3, 0, 168.934f, 66, 3, new int[] {0,2,3,4}, 1.25f, ElementType.LANTHANOID), 123 Yb(70, 6, 104, 1.54f, 0.86f, 3, 0, 12, 2, 0, 173.040f, 67, 3, new int[] {0,2,3}, 1.10f, ElementType.LANTHANOID), 124 Lu(71, 6, 52, 1.53f, 0.85f, 3, 0, 12, 3, 0, 174.970f, 68, 3, new int[] {0,3}, 1.27f, ElementType.LANTHANOID), 125 Hf(72, 6, 41, 1.40f, 1.58f, 4, 0, 12, 4, 0, 178.490f, 68, 4, new int[] {0,2,3,4}, 1.30f, ElementType.TRANSITION_METAL), 126 Ta(73, 6, 91, 1.22f, 1.38f, 5, 0, 12, 5, 0, 180.850f, 68, 5, new int[] {-1,0,2,3,4,5}, 1.50f, ElementType.TRANSITION_METAL), 127 W(74, 6, 101, 1.26f, 1.46f, 6, 0, 12, 6, 0, 183.850f, 68, 6, new int[] {-2,-1,0,1,2,3,4,5,6}, 2.36f, ElementType.TRANSITION_METAL), 128 Re(75, 6, 78, 1.30f, 1.59f, 7, 0, 12, 4, 0, 186.200f, 68, 7, new int[] {-3,-1,0,1,2,3,4,5,6,7}, 1.90f, ElementType.TRANSITION_METAL), 129 Os(76, 6, 66, 1.58f, 1.28f, 8, 0, 12, 2, 0, 190.200f, 68, 4, new int[] {-2,-1,0,1,2,3,4,5,6,7,8}, 2.20f, ElementType.TRANSITION_METAL), 130 Ir(77, 6, 46, 1.22f, 1.37f, 6, 0, 12, 3, 0, 192.220f, 68, 4, new int[] {-3,-1,0,1,2,3,4,5,6,8}, 2.20f, ElementType.TRANSITION_METAL), 131 Pt(78, 6, 74, 1.55f, 1.28f, 4, 0, 6, 0, 0, 195.090f, 68, 4, new int[] {-2,-1,0,1,2,3,4,5,6}, 2.28f, ElementType.TRANSITION_METAL), 132 Au(79, 6, 9, 1.45f, 1.44f, 3, 0, 6, 0, 0, 196.967f, 68, 3, new int[] {-1,0,1,2,3,5}, 2.54f, ElementType.TRANSITION_METAL), 133 Hg(80, 6, 42, 1.55f, 1.32f, 2, 0, 12, 1, 2, 200.59f, 78, 1, new int[] {0,1,2,4}, 2.00f, ElementType.TRANSITION_METAL), 134 Tl(81, 6, 97, 1.96f, 1.45f, 3, 0, 12, 1, 3, 204.3833f, 78, 1, new int[] {-1,0,1,3}, 1.62f, ElementType.POST_TRANSITION_METAL), 135 Pb(82, 6, 69, 2.16f, 1.47f, 4, 0, 12, 2, 4, 207.200f, 78, 2, new int[] {-4,0,2,4}, 2.33f, ElementType.POST_TRANSITION_METAL), 136 Bi(83, 6, 13, 1.73f, 1.46f, 5, 0, 12, 3, 3, 208.981f, 78, 3, new int[] {-3,0,1,3,5}, 2.20f, ElementType.POST_TRANSITION_METAL), 137 Po(84, 6, 72, 1.21f, 0.67f, 6, 0, 12, 4, 2, 209.000f, 78, 4, new int[] {-2,0,2,4,5,6}, 2.0f, ElementType.METALLOID), 138 At(85, 6, 8, 1.12f, 0.62f, 7, 0, 12, 1, 1, 210.000f, 78, -1, new int[] {-1,0,1,3,5,7}, 2.20f, ElementType.HALOGEN), 139 Rn(86, 6, 80, 2.30f, 1.90f, 8, 0, 12, 0, 0, 222.000f, 78, 0, new int[] {0,2,6}, 0.0f, ElementType.NOBLE_GAS), // electroneg not reported 140 Fr(87, 7, 35, 3.24f, 1.80f, 1, 0, 12, 0, 0, 223.000f, -1, 1, new int[] {0,1}, 0.70f, ElementType.ALKALI_METAL), 141 Ra(88, 7, 76, 2.57f, 1.43f, 2, 0, 12, 2, 0, 226.000f, -1, 2, new int[] {0,2}, 0.9f, ElementType.ALKALINE_EARTH_METAL), 142 Ac(89, 7, 2, 2.12f, 1.18f, 3, 0, 12, 4, 0, 227.000f, -1, 3, new int[] {0,2,3}, 1.1f, ElementType.ACTINOID), 143 Th(90, 7, 95, 1.84f, 1.02f, 4, 0, 12, 1, 0, 232.038f, -1, 4, new int[] {0,2,3,4}, 1.30f, ElementType.ACTINOID), 144 Pa(91, 7, 68, 1.60f, 0.89f, 5, 0, 12, 4, 0, 231.036f, -1, 5, new int[] {0,2,3,4,5}, 1.50f, ElementType.ACTINOID), 145 U(92, 7, 99, 1.75f, 0.97f, 6, 0, 12, 4, 0, 238.029f, -1, 6, new int[] {0,2,3,4,5,6}, 1.38f, ElementType.ACTINOID), 146 Np(93, 7, 64, 1.71f, 0.95f, 6, 0, 12, 4, 0, 237.048f, -1, 5, new int[] {0,3,4,5,6,7}, 1.36f, ElementType.ACTINOID), 147 Pu(94, 7, 75, 1.67f, 0.93f, 6, 0, 12, 3, 0, 244.000f, -1, 4, new int[] {0,3,4,5,6,7,8}, 1.28f, ElementType.ACTINOID), 148 Am(95, 7, 5, 1.66f, 0.92f, 6, 0, 12, 3, 0, 243.000f, -1, 3, new int[] {0,2,3,4,5,6,7}, 1.13f, ElementType.ACTINOID), 149 Cm(96, 7, 22, 1.65f, 0.91f, 3, 0, 12, 3, 0, 248.000f, -1, 3, new int[] {0,3,4}, 1.28f, ElementType.ACTINOID), 150 Bk(97, 7, 14, 1.64f, 0.90f, 4, 0, 12, 3, 0, 247.000f, -1, 3, new int[] {0,2,3,4}, 1.30f, ElementType.ACTINOID), 151 Cf(98, 7, 20, 1.63f, 0.89f, 3, 0, 12, 4, 0, 251.000f, -1, 3, new int[] {0,2,3,4}, 1.30f, ElementType.ACTINOID), 152 Es(99, 7, 30, 1.62f, 0.88f, -1, 0, 12, 4, 0, 254.000f, -1, 3, new int[] {0,2,3}, 1.30f, ElementType.ACTINOID), 153 Fm(100, 7, 34, 1.61f, 0.87f, -1, 0, 12, 4, 0, 257.000f, -1, 3, new int[] {0,2,3}, 1.30f, ElementType.ACTINOID), 154 Md(101, 7, 53, 1.60f, 0.86f, -1, 0, 12, 4, 0, 256.000f, -1, 3, new int[] {0,2,3}, 1.30f, ElementType.ACTINOID), 155 No(102, 7, 63, 1.59f, 0.85f, -1, 0, 12, 4, 0, 254.000f, -1, 3, new int[] {0,2,3}, 1.30f, ElementType.ACTINOID), 156 Lr(103, 7, 51, 1.58f, 0.84f, -1, 0, 12, 4, 0, 257.000f, -1, 3, new int[] {0,3}, 0.00f, ElementType.ACTINOID), // electroneg not reported 157 /** 158 * R-group to represent generic groups that are sometimes present in MDL .sdf 159 * files. 160 */ 161 R(104, 0, 105, 0.0f, 0.0f, 0, 0, 4, 1, 0, 0.000f, -1, 3, null, 0.00f, ElementType.UNKNOWN); // this is an R-group 162 // should these be declared final? 163 private int atomicNumber; 164 private int period; 165 //private int hillOrder; 166 private float VDWRadius; // in Angstroms 167 private float covalentRadius; // in Angstroms 168 private int valenceElectronCount; 169 private int minimumValence; 170 private int maximumValence; 171 private int commonValence; 172 private int maximumCovalentValence; 173 private float atomicMass; 174 private int coreElectronCount; 175 private int oxidationState; 176 private int[] allOxidationStates; 177 // Pauling electronegativity: http://en.wikipedia.org/wiki/Electronegativity 178 private float paulingElectronegativity; 179 // Element type: http://www.ptable.com/ 180 private ElementType elementType; 181 //private static final Element[] hillOrderIndex; 182 183// 184// static { 185// hillOrderIndex = new Element[Element.values().length + 1]; 186// for (Element e : Element.values()) { 187// hillOrderIndex[e.getHillOrder()] = e; 188// } 189// hillOrderIndex[Element.H.getHillOrder()] = Element.H; // special case for hydrogen 190// } 191 192 private static final Map<String,Element> allElements ; 193 194 static { 195 allElements = new HashMap<String,Element>(); 196 for (Element e : Element.values()){ 197 allElements.put(e.toString().toLowerCase(), e); 198 } 199 } 200 private Element(int atomicNumber, 201 int period, 202 int hillOrder, 203 float VDWRadius, 204 float covalentRadius, 205 int valenceElectronCount, 206 int minimumValence, 207 int maximumValence, 208 int commonValence, 209 int maximumCovalentValence, 210 float atomicMass, 211 int coreElectronCount, 212 int oxidationState, 213 int[] allOxidationStates, 214 float paulingElectronegativity, 215 ElementType elementType) { 216 217 this.atomicNumber = atomicNumber; 218 this.period = period; 219 //this.hillOrder = hillOrder; 220 this.VDWRadius = VDWRadius; 221 this.covalentRadius = covalentRadius; 222 this.valenceElectronCount = valenceElectronCount; 223 this.minimumValence = minimumValence; 224 this.maximumValence = maximumValence; 225 this.commonValence = commonValence; 226 this.maximumCovalentValence = maximumCovalentValence; 227 this.atomicMass = atomicMass; 228 this.coreElectronCount = coreElectronCount; 229 this.oxidationState = oxidationState; 230 this.allOxidationStates = allOxidationStates; 231 this.paulingElectronegativity = paulingElectronegativity; 232 this.elementType = elementType; 233 234 235 } 236 237 /** 238 * Returns a list of all oxidation states the element is found in. 239 * The set is by Greenwood and Norman in "Chemistry of the Elements (ISBN:0080379419). 240 * @return An array of oxidation states sorted from most negative to most positive. 241 */ 242 public int[] getAllOxidationStates() { 243 return allOxidationStates; 244 } 245 246 /** 247 * Returns the atomic number of this Element. 248 * @return the atomic number of this Element. 249 */ 250 public int getAtomicNumber() { 251 return atomicNumber; 252 } 253 254 /** 255 * Returns the period in the periodic table of this Element. 256 * @return the period in the periodic table of this Element. 257 */ 258 public int getPeriod() { 259 return period; 260 } 261 262 /** 263 * Returns the Hill Order of this Element. The Hill Order represents the 264 * priority by which elements are sorted in molecular formulas. 265 * The Hill system is a system of writing chemical formulas such that the 266 * number of carbon atoms in a molecule is indicated first, the number of 267 * hydrogen atoms next, and then the number of all other chemical elements 268 * subsequently, in alphabetical order. When the formula contains no carbon, 269 * all the elements, including hydrogen, are listed alphabetically. 270 * <p> 271 * Edwin A. Hill, "On A System Of Indexing Chemical Literature; 272 * Adopted By The Classification Division Of The U. S. Patent Office". 273 * J. Am. Chem. Soc. 1900, 22(8), 478-494. 274 * <p> 275 * <a href="http://en.wikipedia.org/wiki/Hill_system"> 276 * http://en.wikipedia.org/wiki/Hill_system</a> 277 * <p> 278 * @return the Hill Order of this Element. 279 */ 280 public int getHillOrder() { 281 throw new RuntimeException("Not implemented, yet!"); 282 //throw new NotImplementedYetException(); 283 //return hillOrder; 284 } 285 286 /** 287 * Returns the van der Waals radius of this Element. 288 * @return the van der Waals radius of this Element, measured in Angstroms. 289 */ 290 public float getVDWRadius() { 291 return VDWRadius; 292 } 293 294 /** 295 * Returns the covalent radius of this Element. 296 * @return covalent radius, measured in Angstroms. 297 */ 298 public float getCovalentRadius() { 299 return covalentRadius; 300 } 301 302 /** 303 * Returns the number of valence electrons for this Element. 304 * @return the number of valence electrons for this Element. 305 */ 306 public int getValenceElectronCount() { 307 return valenceElectronCount; 308 } 309 310 /** 311 * Returns the minimum valence for this Element. 312 * @return the minimum valence of this atom. 313 */ 314 public int getMinimumValence() { 315 return minimumValence; 316 } 317 318 /** 319 * Returns the maximum valence for this Element. 320 * @return the maximum valence for this Element. 321 */ 322 public int getMaximumValence() { 323 return maximumValence; 324 } 325 326 /** 327 * Returns the common valence for this Element. 328 * @return the common valence for this Element. 329 */ 330 public int getCommonValence() { 331 return commonValence; 332 } 333 334 /** 335 * Returns the maximum valence for this Element. 336 * @return the maximum valence of this element. 337 */ 338 public int getMaximumCovalentValence() { 339 return maximumCovalentValence; 340 } 341 342 /** 343 * Returns the atomic mass for this Element. 344 * @return the atomic mass for this Element, measured in g/mol. 345 */ 346 public float getAtomicMass() { 347 return atomicMass; 348 } 349 350 /** 351 * Returns the number of core electrons for this Element. 352 * @return number of core electrons for this Element. 353 */ 354 public int getCoreElectronCount() { 355 return coreElectronCount; 356 } 357 358 /** 359 * Returns a typical oxidation state for this Element. This information is mostly 360 * useful for metals. 361 * @return a typical oxidation state for this Element. 362 */ 363 public int getOxidationState() { 364 return oxidationState; 365 } 366 367 /** 368 * Returns the Pauling electronegativity for this Element. 369 * @return the Pauling electronegativity for this Element. 370 */ 371 public float getPaulingElectronegativity() { 372 return paulingElectronegativity; 373 } 374 375 /** 376 * Returns the Element Type for this Element. 377 * @return the Element Type for this Element. 378 */ 379 public ElementType getElementType() { 380 return elementType; 381 } 382 383 /** 384 * Returns the Element that corresponds to the specified element symbol. The case 385 * of the element symbol is ignored. Example: FE, fe, Fe represent iron. 386 * @param elementSymbol element symbol to specify Element. 387 * @return the Element specified by the element symbol. 388 */ 389 public static Element valueOfIgnoreCase(String elementSymbol) throws IllegalArgumentException { 390 391 Element e = allElements.get(elementSymbol.toLowerCase()); 392 if ( e != null) 393 return e; 394 throw new IllegalArgumentException("Invalid element symbol: " + elementSymbol); 395 } 396 397 /** 398 * Returns <code>true</code> if this Element is Hydrogen. 399 * <p> 400 * <strong>Note:</strong> Deuterium ({@link #D}) and Tritium ({@link Element#T}) will return 401 * <code>true</code> to this method. 402 * </p> 403 * 404 * @return <CODE>true</CODE> if the Element is Hydrogen. 405 */ 406 public boolean isHydrogen() { 407 return this == H || this == D || this == T; 408 } 409 410 /** 411 * Returns <CODE>true</CODE> is the Element is an not Hydrogen (or an 412 * isotope of Hydrogen). 413 * <p> 414 * This method is the exact opposite of {@link #isHydrogen()}. 415 * </p> 416 * 417 * @return <CODE>true</CODE> is Element is not Hydrogen. 418 */ 419 public boolean isHeavyAtom() { 420 return !isHydrogen(); 421 } 422 423 /** 424 * Returns <CODE>true</CODE> if Element is not Hydrogen and not Carbon. 425 * @return <CODE>true</CODE> if Element is not Hydrogen and not Carbon. 426 */ 427 public boolean isHeteroAtom() { 428 return !(this == C || this == H); 429 } 430 431 /** 432 * Returns <CODE>true</CODE> if ElementType is a metal. 433 * @return <CODE>true</CODE> if ElementType is a metal. 434 */ 435 public boolean isMetal() { 436 return elementType.isMetal(); 437 } 438 439 /** 440 * Returns <CODE>true</CODE> if ElementType is a metalloid. 441 * @return <CODE>true</CODE> if ElementType is a metalloid. 442 */ 443 public boolean isMetalloid() { 444 return elementType.isMetalloid(); 445 } 446 447 /** 448 * Returns <CODE>true</CODE> if ElementType is a non-metal. 449 * @return <CODE>true</CODE> if ElementType is a non-metal. 450 */ 451 public boolean isNonMetal() { 452 return elementType.isNonMetal(); 453 } 454 455 /** 456 * Returns <CODE>true</CODE> if Element is a halogen (F, Cl, Br, I, At). 457 * @return <CODE>true</CODE> if Element is a halogen. 458 */ 459 public boolean isHalogen() { 460 return elementType.equals(ElementType.HALOGEN); 461 } 462 463 /** 464 * Returns <CODE>true</CODE> if Element is a chalcogen (O, S, Se, Te, Po). 465 * @return <CODE>true</CODE> if Element is a chalcogen. 466 */ 467 public boolean isChalcogen() { 468 return (this == O || this == S || this == Se || this == Te || 469 this == Po); 470 } 471 472 /** 473 * Returns the Element that corresponds to the specified Hill Order. 474 * @param index the Hill Order. 475 * @return the Element that corresponds to the specified Hill Order. 476 * @see #getHillOrder() 477 */ 478 public static Element getElementFromHillIndex(int index) { 479 throw new UnsupportedOperationException("Not implemented, yet!"); 480 //return hillOrderIndex[index]; 481 } 482}