meshi.energy.solvate.hydrogenBonds
Class AbstractHydrogenBondList

java.lang.Object
  extended by meshi.energy.solvate.hydrogenBonds.AbstractHydrogenBondList
All Implemented Interfaces:
Updateable
Direct Known Subclasses:
HydrogenBondDahiyatList

public abstract class AbstractHydrogenBondList
extends java.lang.Object
implements Updateable

A super class with the most general treatment of a list of hydrogen bonds in an atom list. A specific implementation should put content to these abstract methods according to the specific implementaion of the hydrogen bonds. The constructor gets a distance matrix object, and an AtomList object of all the atoms where bonds are searched. The class is centered around the "bondList" vector that stores all the hydrogen bond objects relevent to the atom list. Whenever a new hydrogen bond appears in the non-bonded-list, it is added to this vector. Hydrogen bonds that are no longer in the non-bonded list are occasionaly removed from this vector. The parameter 'refreshVectorEvery' in the constructor determine how often this 'clean-up' is done. The bondList vector is non-redundent. IPORTANT IMPORTANT IMPORTANT NOTE: The distance matrix must be in an updated state before any of this class's methods are called. If it is not up to date, the results would be meaningless!!! This class does not update the distance matrix on its own at any time!!


Field Summary
protected  AtomList atomList
           
protected  int atomListSize
           
protected  java.util.Vector<AbstractHydrogenBond> bondList
           
protected  DistanceMatrix dm
           
protected  int[] lut
           
protected  AbstractHydrogenBond[][] lutHB
           
protected  int maxAtomNum
           
private  DistanceList newToNonBonded
           
private  int numberOfUpdates
           
private  int refreshVectorEvery
           
 
Constructor Summary
AbstractHydrogenBondList()
           
AbstractHydrogenBondList(DistanceMatrix dm, AtomList atomList, int refreshVectorEvery)
           
 
Method Summary
private  void addNewBondsToList()
          This methods add new h-bonds to the bondList vector.
private  void addToLUTvec(AbstractHydrogenBond[][] vec, Atom atom, AbstractHydrogenBond hb)
          Auxilarry method: Updating a vector, 'vec' similar to the lutHB field, with the new HB The reason we do not access lutHB directly, is that this method is also called from the 'removeBrokenHB' method, and there a different vector need updating.
protected abstract  void buildSpecificStructures()
          This method should build any implementation-specific data structures needed.
protected abstract  AbstractHydrogenBond createHBfromPolars(Atom atom1, Atom atom2)
          This method should build an implementaion specific HB from two polar atoms given as parameters.
 AbstractHydrogenBond findBondByPolars(Atom atom1, Atom atom2)
          This method returns a pointer to the hydrogen bond that exists between two POLAR atoms (hydrogens are not consider polar) If no such object exists then null is returned.
 AbstractHydrogenBond findBondByPolars(int atom1number, int atom2number)
           
 AbstractHydrogenBond[][] lutHB()
           
 void print()
           
private  void removeBrokenHB()
          This method remove from the vector Hydrogen Bond objects, whose distance between polars is so large, they no longer appears in the non-bonded list of the distance matrix.
protected  void update(boolean toRefreshVector, int updateNumber)
          The 'toRefreshVector' parameter determines if broken H-bonds are removed from the vector.
 void update(int updateNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxAtomNum

protected int maxAtomNum

atomListSize

protected int atomListSize

dm

protected DistanceMatrix dm

atomList

protected AtomList atomList

newToNonBonded

private DistanceList newToNonBonded

bondList

protected java.util.Vector<AbstractHydrogenBond> bondList

lut

protected int[] lut

lutHB

protected AbstractHydrogenBond[][] lutHB

numberOfUpdates

private int numberOfUpdates

refreshVectorEvery

private int refreshVectorEvery
Constructor Detail

AbstractHydrogenBondList

public AbstractHydrogenBondList()

AbstractHydrogenBondList

public AbstractHydrogenBondList(DistanceMatrix dm,
                                AtomList atomList,
                                int refreshVectorEvery)
Method Detail

update

public void update(int updateNumber)
            throws UpdateableException
Specified by:
update in interface Updateable
Throws:
UpdateableException

update

protected void update(boolean toRefreshVector,
                      int updateNumber)
               throws UpdateableException
The 'toRefreshVector' parameter determines if broken H-bonds are removed from the vector.

Throws:
UpdateableException

addNewBondsToList

private void addNewBondsToList()
This methods add new h-bonds to the bondList vector. Care is taken to keep the vector non-redundent.


removeBrokenHB

private void removeBrokenHB()
This method remove from the vector Hydrogen Bond objects, whose distance between polars is so large, they no longer appears in the non-bonded list of the distance matrix.


findBondByPolars

public AbstractHydrogenBond findBondByPolars(Atom atom1,
                                             Atom atom2)
This method returns a pointer to the hydrogen bond that exists between two POLAR atoms (hydrogens are not consider polar) If no such object exists then null is returned.


findBondByPolars

public AbstractHydrogenBond findBondByPolars(int atom1number,
                                             int atom2number)

addToLUTvec

private void addToLUTvec(AbstractHydrogenBond[][] vec,
                         Atom atom,
                         AbstractHydrogenBond hb)
Auxilarry method: Updating a vector, 'vec' similar to the lutHB field, with the new HB The reason we do not access lutHB directly, is that this method is also called from the 'removeBrokenHB' method, and there a different vector need updating.


print

public void print()

buildSpecificStructures

protected abstract void buildSpecificStructures()
This method should build any implementation-specific data structures needed.


createHBfromPolars

protected abstract AbstractHydrogenBond createHBfromPolars(Atom atom1,
                                                           Atom atom2)
This method should build an implementaion specific HB from two polar atoms given as parameters. If the creation is not possible then null is returned.


lutHB

public final AbstractHydrogenBond[][] lutHB()