~ubuntu-branches/ubuntu/trusty/cdk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/org/openscience/cdk/interfaces/IBond.java

  • Committer: Bazaar Package Importer
  • Author(s): Paul Cager
  • Date: 2008-04-09 21:17:53 UTC
  • Revision ID: james.westby@ubuntu.com-20080409211753-46lmjw5z8mx5pd8d
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $RCSfile$
 
2
 * $Author: egonw $
 
3
 * $Date: 2007-02-16 13:56:34 +0100 (Fri, 16 Feb 2007) $
 
4
 * $Revision: 7957 $
 
5
 *
 
6
 * Copyright (C) 2006-2007  Egon Willighagen <egonw@users.sf.net>
 
7
 *
 
8
 * Contact: cdk-devel@lists.sourceforge.net
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or
 
11
 * modify it under the terms of the GNU Lesser General Public License
 
12
 * as published by the Free Software Foundation; either version 2.1
 
13
 * of the License, or (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU Lesser General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU Lesser General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
23
 */
 
24
package org.openscience.cdk.interfaces;
 
25
 
 
26
import javax.vecmath.Point2d;
 
27
import javax.vecmath.Point3d;
 
28
 
 
29
/**
 
30
 * Implements the concept of a covalent bond between two or more atoms. A bond is
 
31
 * considered to be a number of electrons connecting two ore more atoms.
 
32
 *
 
33
 * @cdk.module interfaces
 
34
 *
 
35
 * @author      egonw
 
36
 * @cdk.created 2005-08-24
 
37
 * @cdk.keyword bond
 
38
 * @cdk.keyword atom
 
39
 * @cdk.keyword electron
 
40
 */
 
41
public interface IBond extends IElectronContainer {
 
42
 
 
43
        /**
 
44
         *  Returns the Iterator to atoms making up this bond.
 
45
         *
 
46
         *@return    An Iterator to atoms participating in this bond
 
47
         *@see       #setAtoms
 
48
         */
 
49
        public java.util.Iterator atoms();
 
50
 
 
51
        /**
 
52
         * Sets the array of atoms making up this bond.
 
53
         *
 
54
         * @param  atoms  An array of atoms that forms this bond
 
55
         * @see           #atoms
 
56
         */
 
57
        public void setAtoms(IAtom[] atoms);
 
58
 
 
59
        /**
 
60
         * Returns the number of Atoms in this Bond.
 
61
         *
 
62
         * @return    The number of Atoms in this Bond
 
63
         */
 
64
        public int getAtomCount();
 
65
 
 
66
        /**
 
67
         * Returns an Atom from this bond.
 
68
         *
 
69
         * @param  position  The position in this bond where the atom is
 
70
         * @return           The atom at the specified position
 
71
         * @see              #setAtom
 
72
         */
 
73
        public IAtom getAtom(int position);
 
74
 
 
75
 
 
76
        /**
 
77
         * Returns the atom connected to the given atom.
 
78
         *
 
79
         * @param  atom  The atom the bond partner is searched of
 
80
         * @return       the connected atom or null
 
81
         */
 
82
        public IAtom getConnectedAtom(IAtom atom);
 
83
 
 
84
        /**
 
85
         * Returns true if the given atom participates in this bond.
 
86
         *
 
87
         * @param  atom  The atom to be tested if it participates in this bond
 
88
         * @return       true if the atom participates in this bond
 
89
         */
 
90
        public boolean contains(IAtom atom);
 
91
 
 
92
        /**
 
93
         * Sets an Atom in this bond.
 
94
         *
 
95
         * @param  atom      The atom to be set
 
96
         * @param  position  The position in this bond where the atom is to be inserted
 
97
         * @see              #getAtom
 
98
         */
 
99
        public void setAtom(IAtom atom, int position);
 
100
 
 
101
        /**
 
102
         * Returns the bond order of this bond.
 
103
         *
 
104
         * @return The bond order of this bond
 
105
         * @see    org.openscience.cdk.CDKConstants org.openscience.cdk.CDKConstants
 
106
         *         for predefined values.
 
107
         * @see    #setOrder
 
108
         */
 
109
        public double getOrder();
 
110
 
 
111
        /**
 
112
         * Sets the bond order of this bond.
 
113
         *
 
114
         * @param  order The bond order to be assigned to this bond
 
115
         * @see          org.openscience.cdk.CDKConstants for predefined values.
 
116
         * @see          #getOrder
 
117
         */
 
118
        public void setOrder(double order);
 
119
 
 
120
        /**
 
121
         * Returns the stereo descriptor for this bond.
 
122
         *
 
123
         * @return    The stereo descriptor for this bond
 
124
         * @see       #setStereo
 
125
         * @see       org.openscience.cdk.CDKConstants for predefined values.
 
126
         */
 
127
        public int getStereo();
 
128
 
 
129
        /**
 
130
         * Sets the stereo descriptor for this bond.
 
131
         *
 
132
         * @param  stereo  The stereo descriptor to be assigned to this bond.
 
133
         * @see            #getStereo
 
134
         * @see            org.openscience.cdk.CDKConstants for predefined values.
 
135
         */
 
136
        public void setStereo(int stereo);
 
137
 
 
138
        /**
 
139
         * Returns the geometric 2D center of the bond.
 
140
         *
 
141
         * @return    The geometric 2D center of the bond
 
142
         */
 
143
        public Point2d get2DCenter();
 
144
 
 
145
        /**
 
146
         * Returns the geometric 3D center of the bond.
 
147
         *
 
148
         * @return    The geometric 3D center of the bond
 
149
         */
 
150
        public Point3d get3DCenter();
 
151
        
 
152
        /**
 
153
         * Compares a bond with this bond.
 
154
         *
 
155
         * @param  object  Object of type Bond
 
156
         * @return         Return true, if the bond is equal to this bond
 
157
         */
 
158
        public boolean compare(Object object);
 
159
 
 
160
        /**
 
161
         * Checks wether a bond is connected to another one.
 
162
         * This can only be true if the bonds have an Atom in common.
 
163
         *
 
164
         * @param  bond  The bond which is checked to be connect with this one
 
165
         * @return       True, if the bonds share an atom, otherwise false
 
166
         */
 
167
        public boolean isConnectedTo(IBond bond);
 
168
}
 
169