Source code: joelib/algo/morgan/types/SingleTieResolverBO.java
1 ///////////////////////////////////////////////////////////////////////////////
2 // Filename: $RCSfile: SingleTieResolverBO.java,v $
3 // Purpose: Helper class for resolving renumbering ties.
4 // Language: Java
5 // Compiler: JDK 1.4
6 // Authors: Joerg K. Wegner
7 // Version: $Revision: 1.3 $
8 // $Date: 2003/08/19 13:11:24 $
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.algo.morgan.types;
23
24
25 /*==========================================================================*
26 * IMPORTS
27 *========================================================================== */
28 import joelib.algo.morgan.AtomDoubleParent;
29 import joelib.algo.morgan.SingleTieResolver;
30
31 import joelib.molecule.JOEBond;
32 import joelib.molecule.JOEMol;
33
34
35 /*==========================================================================*
36 * CLASS DECLARATION
37 *========================================================================== */
38
39 /**
40 * Interface for resolving renumbering ties.
41 *
42 * @author wegnerj
43 * @license GPL
44 * @cvsversion $Revision: 1.3 $, $Date: 2003/08/19 13:11:24 $
45 */
46 public class SingleTieResolverBO implements SingleTieResolver
47 {
48 //~ Methods ////////////////////////////////////////////////////////////////
49
50 /*-------------------------------------------------------------------------*
51 * public member methods
52 *------------------------------------------------------------------------- */
53 public double getResolvingValue(AtomDoubleParent ap, JOEMol mol)
54 {
55 JOEBond bond = mol.getBond(mol.getAtom(ap.atomIdx),
56 mol.getAtom(ap.parent));
57
58 return (double) bond.getBondOrder();
59 }
60
61 public boolean init(JOEMol mol)
62 {
63 return true;
64 }
65 }
66 ///////////////////////////////////////////////////////////////////////////////
67 // END OF FILE.
68 ///////////////////////////////////////////////////////////////////////////////