Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: joelib/algo/morgan/AtomDoubleParent.java


1   ///////////////////////////////////////////////////////////////////////////////
2   //  Filename: $RCSfile: AtomDoubleParent.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.5 $
8   //            $Date: 2003/08/22 15:56:15 $
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;
23  
24  
25  /*==========================================================================*
26   * IMPORTS
27   *========================================================================== */
28  /*==========================================================================*
29   * CLASS DECLARATION
30   *========================================================================== */
31  
32  /**
33   * Helper class for resolving renumbering ties.
34   *
35   * @author     wegnerj
36   * @license    GPL
37   * @cvsversion    $Revision: 1.5 $, $Date: 2003/08/22 15:56:15 $
38   */
39  public class AtomDoubleParent
40  {
41      //~ Instance fields ////////////////////////////////////////////////////////
42  
43      /**
44       * Renumbering tie flag.
45       */
46      public boolean tie;
47  
48      /**
49       * Temporary and new atom index stored as double value to handle huge
50       * temporary values. The Morgan algorithm can cause really huge
51       * values.
52       */
53      public double tmpAtomIdx;
54  
55      /*-------------------------------------------------------------------------*
56       * public member variables
57       *------------------------------------------------------------------------- */
58  
59      /**
60       * Atom index of the atom.
61       */
62      public int atomIdx;
63  
64      /**
65       * Parent atom index of the atom.
66       */
67      public int parent;
68  
69      //~ Constructors ///////////////////////////////////////////////////////////
70  
71      /*-------------------------------------------------------------------------*
72       * constructor
73       *------------------------------------------------------------------------- */
74  
75      /**
76       *  Constructor for the IntInt object
77       */
78      public AtomDoubleParent()
79      {
80      }
81  
82      /**
83       *  Constructor for the IntInt object
84       *
85       * @param  _i1  Description of the Parameter
86       * @param  _i2  Description of the Parameter
87       */
88      public AtomDoubleParent(int _atomIdx, double _tmpAtomIdx, int _parent,
89          boolean _tie)
90      {
91          atomIdx = _atomIdx;
92          tmpAtomIdx = _tmpAtomIdx;
93          parent = _parent;
94          tie = _tie;
95      }
96  
97      //~ Methods ////////////////////////////////////////////////////////////////
98  
99      public boolean equals(Object otherObj)
100     {
101         if (otherObj instanceof AtomDoubleParent)
102         {
103             AtomDoubleParent ai = (AtomDoubleParent) otherObj;
104 
105             if ((ai.atomIdx == this.atomIdx) &&
106                     (ai.tmpAtomIdx == this.tmpAtomIdx) &&
107                     (ai.parent == this.parent) && (ai.tie == this.tie))
108             {
109                 return true;
110             }
111             else
112             {
113                 return false;
114             }
115         }
116         else
117         {
118             return false;
119         }
120     }
121 
122     public String toString()
123     {
124         return new String("<atomIdx:" + atomIdx + ", tmpAtomIdx:" + tmpAtomIdx +
125             " parent:" + parent + " tie:" + tie + ">");
126     }
127 }
128 ///////////////////////////////////////////////////////////////////////////////
129 //  END OF FILE.
130 ///////////////////////////////////////////////////////////////////////////////