Source code: joelib/desc/types/MolecularWeight.java
1 ///////////////////////////////////////////////////////////////////////////////
2 // Filename: $RCSfile: MolecularWeight.java,v $
3 // Purpose: Calculates the molecular weight.
4 // Language: Java
5 // Compiler: JDK 1.4
6 // Authors: Joerg K. Wegner
7 // Version: $Revision: 1.6 $
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 * ==========================================================================*
27 * IMPORTS
28 * ==========================================================================
29 */
30 import joelib.desc.DescriptorHelper;
31 import joelib.desc.DescriptorInfo;
32 import joelib.desc.SimpleDoubleDesc;
33
34 import joelib.molecule.JOEMol;
35
36 import org.apache.log4j.Category;
37
38
39 /*
40 * ==========================================================================*
41 * CLASS DECLARATION
42 * ==========================================================================
43 */
44
45 /**
46 * Calculates the molecular weight.
47 *
48 * @author wegnerj
49 * @license GPL
50 * @cvsversion $Revision: 1.6 $, $Date: 2003/08/19 13:11:25 $
51 */
52 public class MolecularWeight extends SimpleDoubleDesc
53 {
54 //~ Static fields/initializers /////////////////////////////////////////////
55
56 /*
57 * -------------------------------------------------------------------------*
58 * public static member variables
59 * -------------------------------------------------------------------------
60 */
61
62 /**
63 * Obtain a suitable logger.
64 */
65 private static Category logger = Category.getInstance(
66 "joelib.desc.types.MolecularWeight");
67 public static final String DESC_KEY = "Molecular_weight";
68
69 //~ Constructors ///////////////////////////////////////////////////////////
70
71 /*
72 * -------------------------------------------------------------------------*
73 * constructor
74 * -------------------------------------------------------------------------
75 */
76
77 /**
78 * Constructor for the KierShape1 object
79 */
80 public MolecularWeight()
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.DoubleResult");
90 }
91
92 //~ Methods ////////////////////////////////////////////////////////////////
93
94 /*
95 * -------------------------------------------------------------------------*
96 * public methods
97 * -------------------------------------------------------------------------
98 */
99
100 /**
101 * Gets the doubleValue attribute of the KierShape1 object
102 *
103 * @param mol Description of the Parameter
104 * @return The doubleValue value
105 */
106 public double getDoubleValue(JOEMol mol)
107 {
108 double mw;
109
110 mw = mol.getMolWt();
111
112 return mw;
113 }
114 }
115 ///////////////////////////////////////////////////////////////////////////////
116 // END OF FILE.
117 ///////////////////////////////////////////////////////////////////////////////