org.strbio.mol
Class Molecule

java.lang.Object
  extended by org.strbio.mol.Molecule
Direct Known Subclasses:
Polymer

public class Molecule
extends java.lang.Object

Class to represent a molecule.

 Version 1.1, 7/22/99 - added data field.
 Version 1.01, 3/30/99 - set MAX_NAME_LENGTH to avoid crashing printf
 Version 1.0, 4/16/98 - original version
 

Version:
1.1, 7/22/99
Author:
JMC
See Also:
Atom, AtomNode

Field Summary
 DLinkedList atoms
          pointer to the atoms, if there are any (if not, this is null)
 Data data
          data that is known about this molecule.
static int MAX_NAME_LENGTH
          maximum name length, currently 4096 chars.
 java.lang.String name
          Name of this molecule.
 
Constructor Summary
Molecule()
          Constructor makes everything null.
Molecule(Molecule q)
          copy another molecule, including the atoms.
 
Method Summary
 Atom atomSearch(java.lang.String name)
          Search the atoms of this molecule for the first atom with a given name.
 void clear()
          Forget everything you know about this molecule.
 void copyAtoms(Molecule q)
          copy the atoms from another molecule.
 void rotate(DMatrix rot)
          rotate all atoms by multiplying by a 3x3 rotation matrix.
 void transform(DMatrix trans)
          transform the position of all atoms.
 void translate(DVector trans)
          translate all atoms by adding a DVector(3) to their coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name
Name of this molecule.


atoms

public DLinkedList atoms
pointer to the atoms, if there are any (if not, this is null)


MAX_NAME_LENGTH

public static final int MAX_NAME_LENGTH
maximum name length, currently 4096 chars.

See Also:
Constant Field Values

data

public Data data
data that is known about this molecule.

Constructor Detail

Molecule

public Molecule()
Constructor makes everything null.


Molecule

public Molecule(Molecule q)
copy another molecule, including the atoms. This makes another copy of the data.

Method Detail

clear

public void clear()
Forget everything you know about this molecule.


copyAtoms

public final void copyAtoms(Molecule q)
copy the atoms from another molecule. This makes another copy of the data.


atomSearch

public final Atom atomSearch(java.lang.String name)
Search the atoms of this molecule for the first atom with a given name. Returns null if there isn't one.


translate

public void translate(DVector trans)
translate all atoms by adding a DVector(3) to their coordinates.

See Also:
Atom.translate(org.strbio.math.DVector)

rotate

public void rotate(DMatrix rot)
rotate all atoms by multiplying by a 3x3 rotation matrix.

See Also:
Atom.rotate(org.strbio.math.DMatrix)

transform

public void transform(DMatrix trans)
transform the position of all atoms.

See Also:
Atom.transform(org.strbio.math.DMatrix)