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 028/** 029 * A simple interface for an Atom. 030 * The coordinates can be accessed via the 031 * {@link #getCoords()}, or the 032 * {@link #getX()}, {@link #getY()}, {@link #getZ()} methods. 033 * There are a few additional methods here to provide some PDB specific information. 034 * 035 036 * @author Andreas Prlic 037 * @author Horvath Tamas 038 * @version %I% %G% 039 * @since 1.4 040 * 041 */ 042public interface Atom extends Cloneable, PDBRecord { 043 044 /** 045 * Set atom name, e.g. "CA". 046 * @param s a trimmed String specifying the name value 047 * @see #getName 048 */ 049 public void setName(String s); 050 051 /** 052 * Get atom name, e.g. "CA". 053 * Beware that some PDB atom names are ambiguous (e.g. CA, which means C-alpha or Calcium), 054 * the ambiguity can simply be resolved by also checking the element with {@link #getElement()} 055 * @return a trimmed String representing the name value 056 * @see #setName 057 */ 058 public String getName(); 059 060 /** 061 * Set element of the atom name, e.g. {@link Element#Fe} 062 * @param e an Element enumeration 063 * @see #getElement 064 */ 065 public void setElement(Element e); 066 067 /** 068 * Get element of the atom, e.g. {@link Element#Ca} 069 * @return an Element enumeration 070 * @see #setElement 071 */ 072 public Element getElement(); 073 074 /** 075 * Set PDB atom number. 076 * @param i an int specifying the PDBserial value 077 * @see #getPDBserial 078 */ 079 public void setPDBserial(int i) ; 080 081 /** 082 * Get PDB atom number. 083 * @return an int representing the PDBserial value 084 * @see #setPDBserial 085 */ 086 public int getPDBserial() ; 087 088 /** 089 * Set the coordinates. 090 * @param c an array of doubles specifying the coords value 091 * @see #getCoords 092 */ 093 public void setCoords(double[] c); 094 095 /** 096 * Get the coordinates. 097 * @return an array of doubles representing the coords value 098 * @see #setCoords 099 */ 100 public double[] getCoords() ; 101 102 /** 103 * Set the X coordinate. 104 * @param x a double 105 * @see #getX() 106 */ 107 public void setX(double x); 108 109 /** 110 * Set the Y coordinate. 111 * @param y a double 112 * @see #getY() 113 */ 114 public void setY(double y); 115 116 /** 117 * Set the Z coordinate. 118 * @param z a double 119 * @see #getZ() 120 */ 121 public void setZ(double z); 122 123 /** 124 * Get coordinate X. 125 * @return a double 126 * @see #setX(double) 127 */ 128 public double getX() ; 129 130 /** 131 * Get coordinate Y. 132 * @return a double 133 * @see #setY(double) 134 */ 135 public double getY() ; 136 137 /** 138 * Get coordinate Z. 139 * @return a double 140 * @see #setZ(double) 141 */ 142 public double getZ() ; 143 144 /** 145 * Set alternate Location. 146 * @param c a Character object specifying the alt loc value 147 * @see #getAltLoc 148 */ 149 public void setAltLoc(Character c); 150 151 /** 152 * Get alternate Location. 153 * @return a Character object representing the alt loc value 154 * @see #setAltLoc 155 */ 156 public Character getAltLoc(); 157 158 /** 159 * Set occupancy. 160 * @param occupancy a float specifying the occupancy value 161 * @see #getOccupancy 162 */ 163 public void setOccupancy(float occupancy) ; 164 165 /** 166 * Get occupancy. 167 * @return a float representing the occupancy value 168 * @see #setOccupancy 169 */ 170 public float getOccupancy(); 171 172 /** 173 * Set temp factor . 174 * @param temp a float specifying the temp factor value 175 * @see #getTempFactor 176 */ 177 public void setTempFactor(float temp) ; 178 179 /** 180 * Get temp factor. 181 * @return a float representing the temp factor value 182 * @see #setTempFactor 183 */ 184 public float getTempFactor() ; 185 186 /** 187 * Return an identical copy of this object . 188 * @return an identical copy of this object 189 */ 190 public Object clone(); 191 192 /** 193 * Set the back-reference to its parent Group. 194 * @param parent the parent Group 195 * @see #getGroup() 196 */ 197 198 public void setGroup(Group parent); 199 200 /** 201 * Return the parent Group of the Atom. 202 * returns null if the referenced object is not Group 203 * @return Group the parent Group of the Atom, or null 204 * @see #setGroup(Group) 205 */ 206 public Group getGroup(); 207 208 /** 209 * Add a bond 210 * @param bond to be added 211 * @see #getBonds() 212 */ 213 public void addBond(Bond bond); 214 215 /** 216 * Get all {@link Bond}s this atom is part of. 217 * 218 * @return a list of {@link Bond}s or null if no bonds exist for this Atom 219 */ 220 public List<Bond> getBonds(); 221 222 /** 223 * Sets the bonds 224 * @param bonds 225 */ 226 public void setBonds(List<Bond> bonds); 227 228 229 /** Test if another atom has a bond to this atom 230 * 231 * @param other 232 * @return 233 */ 234 public boolean hasBond(Atom other); 235 236 /** 237 * Get the charge of this atom 238 * 239 * @return a the integer charge. 240 */ 241 public short getCharge(); 242 243 /** 244 * Set the charge of this atom 245 * 246 * @return void. 247 */ 248 public void setCharge(short charge); 249}