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.util.HashMap; 026import java.util.Map; 027 028/** 029 * Element is an enumeration of the elements of the periodic table. In addition, 030 * several attributes of each element are accessible. 031 * <B>Note:</B> Deuterium and Tritium are treated as separate elements D and T, 032 * respectively. Sometimes part of a molecule is represented as an R-group, which 033 * is represented as the element R. 034 * 035 * 036 * @author Peter Rose 037 * @version %I% %G% 038 * @since 3.0 039 * 040 */ 041 042public enum Element { 043 044 // most frequently used elements first 045 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), 046 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), 047 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), 048 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), 049 /** 050 * Deuterium 051 */ 052 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! 053 /** 054 * Tritium 055 */ 056 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! 057 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 058 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), 059 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), 060 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), 061 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), 062 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 063 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), 064 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), 065 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), 066 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), 067 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), 068 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), 069 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), 070 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 071 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), 072 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), 073 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), 074 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), 075 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), 076 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), 077 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), 078 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), 079 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), 080 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), 081 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), 082 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), 083 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), 084 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), 085 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), 086 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), 087 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), 088 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), 089 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), 090 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), 091 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), 092 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), 093 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), 094 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), 095 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), 096 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), 097 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), 098 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), 099 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), 100 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), 101 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), 102 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), 103 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), 104 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), 105 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), 106 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), 107 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), 108 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), 109 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), 110 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), 111 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), 112 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), 113 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), 114 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), 115 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), 116 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), 117 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), 118 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), 119 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), 120 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), 121 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), 122 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), 123 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), 124 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), 125 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), 126 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), 127 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), 128 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), 129 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), 130 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), 131 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), 132 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), 133 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), 134 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), 135 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), 136 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), 137 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), 138 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 139 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), 140 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), 141 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), 142 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), 143 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), 144 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), 145 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), 146 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), 147 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), 148 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), 149 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), 150 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), 151 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), 152 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), 153 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), 154 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), 155 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 156 /** 157 * R-group to represent generic groups that are sometimes present in MDL .sdf 158 * files. 159 */ 160 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 161 // should these be declared final? 162 private int atomicNumber; 163 private int period; 164 //private int hillOrder; 165 private float VDWRadius; // in Angstroms 166 private float covalentRadius; // in Angstroms 167 private int valenceElectronCount; 168 private int minimumValence; 169 private int maximumValence; 170 private int commonValence; 171 private int maximumCovalentValence; 172 private float atomicMass; 173 private int coreElectronCount; 174 private int oxidationState; 175 private int[] allOxidationStates; 176 // Pauling electronegativity: http://en.wikipedia.org/wiki/Electronegativity 177 private float paulingElectronegativity; 178 // Element type: http://www.ptable.com/ 179 private ElementType elementType; 180 //private static final Element[] hillOrderIndex; 181 182// 183// static { 184// hillOrderIndex = new Element[Element.values().length + 1]; 185// for (Element e : Element.values()) { 186// hillOrderIndex[e.getHillOrder()] = e; 187// } 188// hillOrderIndex[Element.H.getHillOrder()] = Element.H; // special case for hydrogen 189// } 190 191 private static final Map<String,Element> allElements ; 192 193 static { 194 allElements = new HashMap<String,Element>(); 195 for (Element e : Element.values()){ 196 allElements.put(e.toString().toLowerCase(), e); 197 } 198 } 199 private Element(int atomicNumber, 200 int period, 201 int hillOrder, 202 float VDWRadius, 203 float covalentRadius, 204 int valenceElectronCount, 205 int minimumValence, 206 int maximumValence, 207 int commonValence, 208 int maximumCovalentValence, 209 float atomicMass, 210 int coreElectronCount, 211 int oxidationState, 212 int[] allOxidationStates, 213 float paulingElectronegativity, 214 ElementType elementType) { 215 216 this.atomicNumber = atomicNumber; 217 this.period = period; 218 //this.hillOrder = hillOrder; 219 this.VDWRadius = VDWRadius; 220 this.covalentRadius = covalentRadius; 221 this.valenceElectronCount = valenceElectronCount; 222 this.minimumValence = minimumValence; 223 this.maximumValence = maximumValence; 224 this.commonValence = commonValence; 225 this.maximumCovalentValence = maximumCovalentValence; 226 this.atomicMass = atomicMass; 227 this.coreElectronCount = coreElectronCount; 228 this.oxidationState = oxidationState; 229 this.allOxidationStates = allOxidationStates; 230 this.paulingElectronegativity = paulingElectronegativity; 231 this.elementType = elementType; 232 233 234 } 235 236 /** 237 * Returns a list of all oxidation states the element is found in. 238 * The set is by Greenwood and Norman in "Chemistry of the Elements (ISBN:0080379419). 239 * @return An array of oxidation states sorted from most negative to most positive. 240 */ 241 public int[] getAllOxidationStates() { 242 return allOxidationStates; 243 } 244 245 /** 246 * Returns the atomic number of this Element. 247 * @return the atomic number of this Element. 248 */ 249 public int getAtomicNumber() { 250 return atomicNumber; 251 } 252 253 /** 254 * Returns the period in the periodic table of this Element. 255 * @return the period in the periodic table of this Element. 256 */ 257 public int getPeriod() { 258 return period; 259 } 260 261 /** 262 * Returns the Hill Order of this Element. The Hill Order represents the 263 * priority by which elements are sorted in molecular formulas. 264 * The Hill system is a system of writing chemical formulas such that the 265 * number of carbon atoms in a molecule is indicated first, the number of 266 * hydrogen atoms next, and then the number of all other chemical elements 267 * subsequently, in alphabetical order. When the formula contains no carbon, 268 * all the elements, including hydrogen, are listed alphabetically. 269 * <p> 270 * Edwin A. Hill, "On A System Of Indexing Chemical Literature; 271 * Adopted By The Classification Division Of The U. S. Patent Office". 272 * J. Am. Chem. Soc. 1900, 22(8), 478-494. 273 * <p> 274 * <a href="http://en.wikipedia.org/wiki/Hill_system"> 275 * http://en.wikipedia.org/wiki/Hill_system</a> 276 * <p> 277 * @return the Hill Order of this Element. 278 */ 279 public int getHillOrder() { 280 throw new RuntimeException("Not implemented, yet!"); 281 //throw new NotImplementedYetException(); 282 //return hillOrder; 283 } 284 285 /** 286 * Returns the van der Waals radius of this Element. 287 * @return the van der Waals radius of this Element, measured in Angstroms. 288 */ 289 public float getVDWRadius() { 290 return VDWRadius; 291 } 292 293 /** 294 * Returns the covalent radius of this Element. 295 * @return covalent radius, measured in Angstroms. 296 */ 297 public float getCovalentRadius() { 298 return covalentRadius; 299 } 300 301 /** 302 * Returns the number of valence electrons for this Element. 303 * @return the number of valence electrons for this Element. 304 */ 305 public int getValenceElectronCount() { 306 return valenceElectronCount; 307 } 308 309 /** 310 * Returns the minimum valence for this Element. 311 * @return the minimum valence of this atom. 312 */ 313 public int getMinimumValence() { 314 return minimumValence; 315 } 316 317 /** 318 * Returns the maximum valence for this Element. 319 * @return the maximum valence for this Element. 320 */ 321 public int getMaximumValence() { 322 return maximumValence; 323 } 324 325 /** 326 * Returns the common valence for this Element. 327 * @return the common valence for this Element. 328 */ 329 public int getCommonValence() { 330 return commonValence; 331 } 332 333 /** 334 * Returns the maximum valence for this Element. 335 * @return the maximum valence of this element. 336 */ 337 public int getMaximumCovalentValence() { 338 return maximumCovalentValence; 339 } 340 341 /** 342 * Returns the atomic mass for this Element. 343 * @return the atomic mass for this Element, measured in g/mol. 344 */ 345 public float getAtomicMass() { 346 return atomicMass; 347 } 348 349 /** 350 * Returns the number of core electrons for this Element. 351 * @return number of core electrons for this Element. 352 */ 353 public int getCoreElectronCount() { 354 return coreElectronCount; 355 } 356 357 /** 358 * Returns a typical oxidation state for this Element. This information is mostly 359 * useful for metals. 360 * @return a typical oxidation state for this Element. 361 */ 362 public int getOxidationState() { 363 return oxidationState; 364 } 365 366 /** 367 * Returns the Pauling electronegativity for this Element. 368 * @return the Pauling electronegativity for this Element. 369 */ 370 public float getPaulingElectronegativity() { 371 return paulingElectronegativity; 372 } 373 374 /** 375 * Returns the Element Type for this Element. 376 * @return the Element Type for this Element. 377 */ 378 public ElementType getElementType() { 379 return elementType; 380 } 381 382 /** 383 * Returns the Element that corresponds to the specified element symbol. The case 384 * of the element symbol is ignored. Example: FE, fe, Fe represent iron. 385 * @param elementSymbol element symbol to specify Element. 386 * @return the Element specified by the element symbol. 387 */ 388 public static Element valueOfIgnoreCase(String elementSymbol) throws IllegalArgumentException { 389 390 Element e = allElements.get(elementSymbol.toLowerCase()); 391 if ( e != null) 392 return e; 393 throw new IllegalArgumentException("Invalid element symbol: " + elementSymbol); 394 } 395 396 /** 397 * Returns <code>true</code> if this Element is Hydrogen. 398 * <p> 399 * <strong>Note:</strong> Deuterium ({@link #D}) and Tritium ({@link Element#T}) will return 400 * <code>true</code> to this method. 401 * </p> 402 * 403 * @return <CODE>true</CODE> if the Element is Hydrogen. 404 */ 405 public boolean isHydrogen() { 406 return this == H || this == D || this == T; 407 } 408 409 /** 410 * Returns <CODE>true</CODE> is the Element is an not Hydrogen (or an 411 * isotope of Hydrogen). 412 * <p> 413 * This method is the exact opposite of {@link #isHydrogen()}. 414 * </p> 415 * 416 * @return <CODE>true</CODE> is Element is not Hydrogen. 417 */ 418 public boolean isHeavyAtom() { 419 return !isHydrogen(); 420 } 421 422 /** 423 * Returns <CODE>true</CODE> if Element is not Hydrogen and not Carbon. 424 * @return <CODE>true</CODE> if Element is not Hydrogen and not Carbon. 425 */ 426 public boolean isHeteroAtom() { 427 return !(this == C || this == H); 428 } 429 430 /** 431 * Returns <CODE>true</CODE> if ElementType is a metal. 432 * @return <CODE>true</CODE> if ElementType is a metal. 433 */ 434 public boolean isMetal() { 435 return elementType.isMetal(); 436 } 437 438 /** 439 * Returns <CODE>true</CODE> if ElementType is a metalloid. 440 * @return <CODE>true</CODE> if ElementType is a metalloid. 441 */ 442 public boolean isMetalloid() { 443 return elementType.isMetalloid(); 444 } 445 446 /** 447 * Returns <CODE>true</CODE> if ElementType is a non-metal. 448 * @return <CODE>true</CODE> if ElementType is a non-metal. 449 */ 450 public boolean isNonMetal() { 451 return elementType.isNonMetal(); 452 } 453 454 /** 455 * Returns <CODE>true</CODE> if Element is a halogen (F, Cl, Br, I, At). 456 * @return <CODE>true</CODE> if Element is a halogen. 457 */ 458 public boolean isHalogen() { 459 return elementType.equals(ElementType.HALOGEN); 460 } 461 462 /** 463 * Returns <CODE>true</CODE> if Element is a chalcogen (O, S, Se, Te, Po). 464 * @return <CODE>true</CODE> if Element is a chalcogen. 465 */ 466 public boolean isChalcogen() { 467 return (this == O || this == S || this == Se || this == Te || 468 this == Po); 469 } 470 471 /** 472 * Returns the Element that corresponds to the specified Hill Order. 473 * @param index the Hill Order. 474 * @return the Element that corresponds to the specified Hill Order. 475 * @see #getHillOrder() 476 */ 477 public static Element getElementFromHillIndex(int index) { 478 throw new UnsupportedOperationException("Not implemented, yet!"); 479 //return hillOrderIndex[index]; 480 } 481}