KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > chemistry > CovalentBond


1 package JSci.chemistry;
2
3 /**
4 * A covalent bond between two atoms.
5 */

6 public class CovalentBond extends Bond {
7         /** Sigma bond */
8         public static final int SINGLE = 1;
9         /** Sigma and one pi bond */
10         public static final int DOUBLE = 2;
11         /** Sigma and two pi bonds */
12         public static final int TRIPLE = 3;
13
14         private final int type;
15         /**
16         * Constructs a sigma bond between two atoms.
17         */

18         public CovalentBond(Atom a, Atom b) {
19                 this(a, b, SINGLE);
20         }
21         /**
22         * Constructs a covalent bond between two atoms.
23         * @param bondType one of SINGLE, DOUBLE or TRIPLE.
24         */

25         public CovalentBond(Atom a, Atom b, int bondType) {
26                 super(a, b);
27                 type = bondType;
28         }
29 }
30
31
Popular Tags