Package org.biojava.nbio.structure
Class AtomImpl
- java.lang.Object
- 
- org.biojava.nbio.structure.AtomImpl
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Atom,- PDBRecord
 
 public class AtomImpl extends Object implements Atom Implementation of an Atom of a PDB file. currently the coordinates of an atom are represented by a double[3] array.- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intBONDS_INITIAL_CAPACITYThe inital capacity of the bonds list.
 - 
Constructor SummaryConstructors Constructor Description AtomImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBond(Bond bond)Add a bondObjectclone()returns and identical copy of this object .CharactergetAltLoc()Get alternate Location.List<Bond>getBonds()Get allBonds this atom is part of.shortgetCharge()Get the charge of this atomdouble[]getCoords()Get the coordinates.javax.vecmath.Point3dgetCoordsAsPoint3d()Get the coordinates.ElementgetElement()Get element of the atom, e.g.GroupgetGroup()Return the parent Group of the Atom.StringgetName()Get atom name, e.g.floatgetOccupancy()Get occupancy.intgetPDBserial()Get PDB atom number.floatgetTempFactor()Get temp factor.doublegetX()Get coordinate X.doublegetY()Get coordinate Y.doublegetZ()Get coordinate Z.booleanhasBond(Atom other)Test if another atom has a bond to this atomvoidsetAltLoc(Character c)Set alternate Location.voidsetBonds(List<Bond> bonds)Sets the bondsvoidsetCharge(short inputCharge)Set the charge of this atomvoidsetCoords(double[] c)Set the coordinates.voidsetElement(Element e)Set element of the atom name, e.g.voidsetGroup(Group parent)Set the back-reference to its parent Group.voidsetName(String s)Set atom name, e.g.voidsetOccupancy(float occu)Set occupancy.voidsetPDBserial(int i)Set PDB atom number.voidsetTempFactor(float temp)Set temp factor .voidsetX(double x)Set the X coordinate.voidsetY(double y)Set the Y coordinate.voidsetZ(double z)Set the Z coordinate.StringtoPDB()Returns a PDB file like representation of this record.voidtoPDB(StringBuffer buf)Appends a PDB file like representation of this record to the provided StringBuffer.StringtoString()
 
- 
- 
- 
Field Detail- 
BONDS_INITIAL_CAPACITYpublic static final int BONDS_INITIAL_CAPACITY The inital capacity of the bonds list. Most atoms have a maximum of 3 heavy atom neighbors.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
AtomImplpublic AtomImpl() 
 
- 
 - 
Method Detail- 
setNamepublic void setName(String s) Set atom name, e.g. "CA".- Specified by:
- setNamein interface- Atom
- Parameters:
- s- a trimmed String specifying the name value
- See Also:
- Atom.getName()
 
 - 
getNamepublic String getName() Get atom name, e.g. "CA". Beware that some PDB atom names are ambiguous (e.g. CA, which means C-alpha or Calcium), the ambiguity can simply be resolved by also checking the element withAtom.getElement()- Specified by:
- getNamein interface- Atom
- Returns:
- a trimmed String representing the name value
- See Also:
- Atom.setName(java.lang.String)
 
 - 
setPDBserialpublic void setPDBserial(int i) Set PDB atom number.- Specified by:
- setPDBserialin interface- Atom
- Parameters:
- i- an int specifying the PDBserial value
- See Also:
- Atom.getPDBserial()
 
 - 
getPDBserialpublic int getPDBserial() Get PDB atom number.- Specified by:
- getPDBserialin interface- Atom
- Returns:
- an int representing the PDBserial value
- See Also:
- Atom.setPDBserial(int)
 
 - 
setCoordspublic void setCoords(double[] c) Set the coordinates.- Specified by:
- setCoordsin interface- Atom
- Parameters:
- c- an array of doubles specifying the coords value
- See Also:
- Atom.getCoords()
 
 - 
getCoordspublic double[] getCoords() Get the coordinates.- Specified by:
- getCoordsin interface- Atom
- Returns:
- a new array of doubles representing the coords value
- See Also:
- Atom.setCoords(double[]),- Atom.getCoordsAsPoint3d()
 
 - 
getCoordsAsPoint3dpublic javax.vecmath.Point3d getCoordsAsPoint3d() Get the coordinates.Internally the coordinates are represented as Point3d so this is recommended over Atom.getCoords()- Specified by:
- getCoordsAsPoint3din interface- Atom
- Returns:
- a reference to the Point3d coordinates
- See Also:
- Atom.getCoords()
 
 - 
setXpublic void setX(double x) Description copied from interface:AtomSet the X coordinate.- Specified by:
- setXin interface- Atom
- Parameters:
- x- a double
- See Also:
- Atom.getX()
 
 - 
setYpublic void setY(double y) Description copied from interface:AtomSet the Y coordinate.- Specified by:
- setYin interface- Atom
- Parameters:
- y- a double
- See Also:
- Atom.getY()
 
 - 
setZpublic void setZ(double z) Description copied from interface:AtomSet the Z coordinate.- Specified by:
- setZin interface- Atom
- Parameters:
- z- a double
- See Also:
- Atom.getZ()
 
 - 
getXpublic double getX() Get coordinate X.- Specified by:
- getXin interface- Atom
- Returns:
- a double
- See Also:
- Atom.setX(double)
 
 - 
getYpublic double getY() Get coordinate Y.- Specified by:
- getYin interface- Atom
- Returns:
- a double
- See Also:
- Atom.setY(double)
 
 - 
getZpublic double getZ() Get coordinate Z.- Specified by:
- getZin interface- Atom
- Returns:
- a double
- See Also:
- Atom.setZ(double)
 
 - 
setAltLocpublic void setAltLoc(Character c) Set alternate Location.- Specified by:
- setAltLocin interface- Atom
- Parameters:
- c- a Character object specifying the alt loc value
- See Also:
- getAltLoc()
 
 - 
getAltLocpublic Character getAltLoc() Get alternate Location.- Specified by:
- getAltLocin interface- Atom
- Returns:
- a Character object representing the alt loc value
- See Also:
- setAltLoc(java.lang.Character)
 
 - 
setOccupancypublic void setOccupancy(float occu) Description copied from interface:AtomSet occupancy.- Specified by:
- setOccupancyin interface- Atom
- Parameters:
- occu- a float specifying the occupancy value
- See Also:
- Atom.getOccupancy()
 
 - 
getOccupancypublic float getOccupancy() Description copied from interface:AtomGet occupancy.- Specified by:
- getOccupancyin interface- Atom
- Returns:
- a float representing the occupancy value
- See Also:
- Atom.setOccupancy(float)
 
 - 
setTempFactorpublic void setTempFactor(float temp) Description copied from interface:AtomSet temp factor .- Specified by:
- setTempFactorin interface- Atom
- Parameters:
- temp- a float specifying the temp factor value
- See Also:
- Atom.getTempFactor()
 
 - 
getTempFactorpublic float getTempFactor() Description copied from interface:AtomGet temp factor.- Specified by:
- getTempFactorin interface- Atom
- Returns:
- a float representing the temp factor value
- See Also:
- Atom.setTempFactor(float)
 
 - 
setGrouppublic void setGroup(Group parent) Set the back-reference to its parent Group.- Specified by:
- setGroupin interface- Atom
- Parameters:
- parent- the parent Group
- See Also:
- Atom.getGroup()
 
 - 
getGrouppublic Group getGroup() Return the parent Group of the Atom. returns null if the referenced object is not Group- Specified by:
- getGroupin interface- Atom
- Returns:
- Group the parent Group of the Atom, or null
- See Also:
- Atom.setGroup(Group)
 
 - 
getElementpublic Element getElement() Get element of the atom, e.g.Element.Ca- Specified by:
- getElementin interface- Atom
- Returns:
- an Element enumeration
- See Also:
- Atom.setElement(org.biojava.nbio.structure.Element)
 
 - 
setElementpublic void setElement(Element e) Set element of the atom name, e.g.Element.Fe- Specified by:
- setElementin interface- Atom
- Parameters:
- e- an Element enumeration
- See Also:
- Atom.getElement()
 
 - 
toPDBpublic String toPDB() Description copied from interface:PDBRecordReturns a PDB file like representation of this record.
 - 
toPDBpublic void toPDB(StringBuffer buf) Description copied from interface:PDBRecordAppends a PDB file like representation of this record to the provided StringBuffer.
 - 
addBondpublic void addBond(Bond bond) Description copied from interface:AtomAdd a bond- Specified by:
- addBondin interface- Atom
- Parameters:
- bond- to be added
- See Also:
- Atom.getBonds()
 
 - 
getChargepublic short getCharge() Description copied from interface:AtomGet the charge of this atom
 
- 
 
-