001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 * Created on 28.04.2004
021 * @author Andreas Prlic
022 *
023 */
024package org.biojava.nbio.structure;
025
026import java.util.List;
027
028import javax.vecmath.Point3d;
029
030/**
031 * A simple interface for an Atom.
032 * The coordinates can be accessed via the
033 * {@link #getCoords()}, or the
034 * {@link #getX()}, {@link #getY()}, {@link #getZ()} methods.
035 * There are a few additional methods here to provide some PDB specific information.
036 *
037
038 * @author Andreas Prlic
039 * @author Horvath Tamas
040 * @version %I% %G%
041 * @since 1.4
042 *
043 */
044public interface Atom extends Cloneable, PDBRecord {
045
046        /**
047         * Set atom name, e.g. "CA".
048         * @param s  a trimmed String specifying the name value
049         * @see #getName
050         */
051        public void   setName(String s);
052
053        /**
054         * Get atom name, e.g. "CA".
055         * Beware that some PDB atom names are ambiguous (e.g. CA, which means C-alpha or Calcium),
056         * the ambiguity can simply be resolved by also checking the element with {@link #getElement()}
057         * @return a trimmed String representing the name value
058         * @see #setName
059         */
060        public String getName();
061
062        /**
063         * Set element of the atom name, e.g. {@link Element#Fe}
064         * @param e  an Element enumeration
065         * @see #getElement
066         */
067        public void   setElement(Element e);
068
069        /**
070         * Get element of the atom, e.g. {@link Element#Ca}
071         * @return an Element enumeration
072         * @see #setElement
073         */
074        public Element getElement();
075
076        /**
077         * Set PDB atom number.
078         * @param i  an int specifying the PDBserial value
079         * @see #getPDBserial
080         */
081        public void setPDBserial(int i) ;
082
083        /**
084         * Get PDB atom number.
085         * @return an int representing the PDBserial value
086         * @see #setPDBserial
087         */
088        public int  getPDBserial() ;
089
090        /**
091         * Set the coordinates.
092         * @param c  an array of doubles specifying the coords value
093         * @see #getCoords
094         */
095        public void    setCoords(double[] c);
096
097        /**
098         * Get the coordinates.
099         * @return a new array of doubles representing the coords value
100         * @see #setCoords
101         * @see #getCoordsAsPoint3d()
102         */
103        public double[] getCoords() ;
104
105        /**
106         * Get the coordinates.
107         * <p>
108         * Internally the coordinates are represented as Point3d so this
109         * is recommended over {@link #getCoords()}
110         * @return a reference to the Point3d coordinates
111         * @see #getCoords()
112         */
113        public Point3d getCoordsAsPoint3d();
114
115        /**
116         * Set the X coordinate.
117         * @param x  a double
118         * @see #getX()
119         */
120        public void setX(double x);
121
122        /**
123         * Set the Y coordinate.
124         * @param y  a double
125         * @see #getY()
126         */
127        public void setY(double y);
128
129        /**
130         * Set the Z coordinate.
131         * @param z  a double
132         * @see #getZ()
133         */
134        public void setZ(double z);
135
136        /**
137         * Get coordinate X.
138         * @return a double
139         * @see #setX(double)
140         */
141        public double getX() ;
142
143        /**
144         * Get coordinate Y.
145         * @return a double
146         * @see #setY(double)
147         */
148        public double getY() ;
149
150        /**
151         * Get coordinate Z.
152         * @return a double
153         * @see #setZ(double)
154         */
155        public double getZ() ;
156
157        /**
158         * Set alternate Location.
159         * @param c  a Character object specifying the alt loc value
160         * @see #getAltLoc
161         */
162        public void setAltLoc(Character c);
163
164        /**
165         * Get alternate Location.
166         * @return a Character object representing the alt loc value. Default altLoc ('.' in mmCIF files)
167         * is represented by ' ' (space character, ascii 32).
168         * @see #setAltLoc
169         */
170        public Character getAltLoc();
171
172        /**
173         * Set occupancy.
174         * @param occupancy  a float specifying the occupancy value
175         * @see #getOccupancy
176         */
177        public void setOccupancy(float occupancy) ;
178
179        /**
180         * Get occupancy.
181         * @return a float representing the occupancy value
182         * @see #setOccupancy
183         */
184        public float getOccupancy();
185
186        /**
187         * Set temp factor .
188         * @param temp  a float specifying the temp factor value
189         * @see #getTempFactor
190         */
191        public void   setTempFactor(float temp) ;
192
193        /**
194         * Get temp factor.
195         * @return a float representing the temp factor value
196         * @see #setTempFactor
197         */
198        public float getTempFactor() ;
199
200        /**
201         * Return an identical copy of this  object .
202         * @return  an identical copy of this  object
203         */
204        public Object clone();
205
206        /**
207         * Set the back-reference to its parent Group.
208         * @param parent the parent Group
209         * @see #getGroup()
210         */
211
212        public void setGroup(Group parent);
213
214        /**
215         * Return the parent Group of the Atom.
216         * returns null if the referenced object is not Group
217         * @return Group the parent Group of the Atom, or null
218         * @see #setGroup(Group)
219         */
220        public Group getGroup();
221
222        /**
223         * Add a bond
224         * @param bond to be added
225         * @see #getBonds()
226         */
227        public void addBond(Bond bond);
228
229        /**
230         * Get all {@link Bond}s this atom is part of.
231         *
232         * @return a list of {@link Bond}s or null if no bonds exist for this Atom
233         */
234        public List<Bond> getBonds();
235
236        /**
237         * Sets the bonds
238         * @param bonds
239         */
240        public void setBonds(List<Bond> bonds);
241
242
243        /**
244         * Test if another atom has a bond to this atom
245         *
246         * @param other
247         * @return
248         */
249        public boolean hasBond(Atom other);
250
251        /**
252         * Get the charge of this atom
253         *
254         * @return a the integer charge.
255         */
256        public short getCharge();
257
258        /**
259         * Set the charge of this atom
260         *
261         * @return void.
262         */
263        public void setCharge(short charge);
264}