Source code: joelib/desc/types/ElectronegativityPauling.java
1 ///////////////////////////////////////////////////////////////////////////////
2 // Filename: $RCSfile: ElectronegativityPauling.java,v $
3 // Purpose: Electronegativity after Pauling.
4 // Language: Java
5 // Compiler: JDK 1.4
6 // Authors: Joerg K. Wegner
7 // Version: $Revision: 1.7 $
8 // $Date: 2003/08/19 13:11:25 $
9 // $Author: wegner $
10 //
11 // Copyright (c) Dept. Computer Architecture, University of Tuebingen, Germany
12 //
13 // This program is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation version 2 of the License.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 ///////////////////////////////////////////////////////////////////////////////
22 package joelib.desc.types;
23
24
25 /*==========================================================================*
26 * IMPORTS
27 *==========================================================================*/
28 import joelib.desc.DescriptorHelper;
29 import joelib.desc.DescriptorInfo;
30 import joelib.desc.SimpleDynamicAtomProperty;
31
32 import joelib.desc.result.DynamicArrayResult;
33
34 import joelib.molecule.JOEAtom;
35 import joelib.molecule.JOEMol;
36
37 import joelib.util.iterator.AtomIterator;
38
39 import org.apache.log4j.Category;
40
41
42 /*==========================================================================*
43 * CLASS DECLARATION
44 *==========================================================================*/
45
46 /**
47 * Electronegativity after Pauling.
48 *
49 * @author wegnerj
50 * @license GPL
51 * @cvsversion $Revision: 1.7 $, $Date: 2003/08/19 13:11:25 $
52 */
53 public class ElectronegativityPauling extends SimpleDynamicAtomProperty
54 {
55 //~ Static fields/initializers /////////////////////////////////////////////
56
57 /*-------------------------------------------------------------------------*
58 * public static member variables
59 *-------------------------------------------------------------------------*/
60
61 /**
62 * Obtain a suitable logger.
63 */
64 private static Category logger = Category.getInstance(
65 "joelib.desc.types.ElectronegativityPauling");
66 public static final String DESC_KEY = "Electronegativity_pauling";
67
68 //~ Constructors ///////////////////////////////////////////////////////////
69
70 /*-------------------------------------------------------------------------*
71 * private variables
72 *-------------------------------------------------------------------------*/
73 /*-------------------------------------------------------------------------*
74 * constructor
75 *-------------------------------------------------------------------------*/
76
77 /**
78 * Constructor for the KierShape1 object
79 */
80 public ElectronegativityPauling()
81 {
82 if (logger.isDebugEnabled())
83 {
84 logger.debug("Initialize " + this.getClass().getName());
85 }
86
87 descInfo = DescriptorHelper.generateDescInfo(DESC_KEY, this.getClass(),
88 DescriptorInfo.TYPE_NO_COORDINATES, null,
89 "joelib.desc.result.AtomDynamicResult");
90 }
91
92 //~ Methods ////////////////////////////////////////////////////////////////
93
94 /*-------------------------------------------------------------------------*
95 * public methods
96 *-------------------------------------------------------------------------*/
97 public Object getAtomPropertiesArray(JOEMol mol)
98 {
99 // get partial charges for all atoms
100 JOEAtom atom;
101 AtomIterator ait = mol.atomIterator();
102 double[] enPauling = (double[]) DynamicArrayResult.getNewArray(DynamicArrayResult.DOUBLE,
103 mol.numAtoms());
104 int i = 0;
105
106 while (ait.hasNext())
107 {
108 atom = ait.nextAtom();
109 enPauling[i++] = atom.getENPauling();
110 }
111
112 return enPauling;
113 }
114 }
115
116 /*-------------------------------------------------------------------------*
117 * END
118 *-------------------------------------------------------------------------*/
119
120 ///////////////////////////////////////////////////////////////////////////////
121 // END OF FILE.
122 ///////////////////////////////////////////////////////////////////////////////