chemaxon.reaction
Class CutBondReviser

java.lang.Object
  extended by chemaxon.reaction.CutBondReviser
Direct Known Subclasses:
Recap

public class CutBondReviser
extends java.lang.Object

Common base class for the classes that perform the revision of planned cut-bonds. This implementation accepts all cut-bonds. The Fragmenter module cuts only those bonds that are accepted by the reviser.

Since:
JChem 2.0
Author:
Nora Mate

Field Summary
protected  chemaxon.util.BondClassifier classifier
          The classifier object that performs the DFS algorithm and stores ring-bond data.
protected  Fragmenter fragmenter
          The fragmenter.
protected  Molecule mol
          The input molecule.
 
Constructor Summary
CutBondReviser()
          Default constructor.
 
Method Summary
 void clear(int a1, int a2)
          Clears cut-bond.
static CutBondReviser create(org.dom4j.Element element, Standardizer standardizer, java.lang.String dir)
          Creates a CutBondReviser object corresponding to the given DOM element node.
protected  Molecule getMolecule()
          Returns the input molecule.
protected  void init(org.dom4j.Element element, Standardizer standardizer, java.lang.String dir)
          Initializes the reviser.
 boolean revise(int a1, int a2)
          Returns true if the cut-bond is accepted, false otherwise.
 void set(int a1, int a2)
          Sets cut-bond.
protected  void setFragmenter(Fragmenter fragmenter)
          Sets the fragmenter.
protected  void setMolecule(Molecule mol)
          Sets the input molecule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fragmenter

protected Fragmenter fragmenter
The fragmenter.


classifier

protected chemaxon.util.BondClassifier classifier
The classifier object that performs the DFS algorithm and stores ring-bond data.


mol

protected Molecule mol
The input molecule.

Constructor Detail

CutBondReviser

public CutBondReviser()
Default constructor.

Method Detail

create

public static CutBondReviser create(org.dom4j.Element element,
                                    Standardizer standardizer,
                                    java.lang.String dir)
                             throws java.io.IOException
Creates a CutBondReviser object corresponding to the given DOM element node.

Parameters:
element - is the reviser configuration DOM element node
standardizer - is the standardizer object
dir - is the root directory
Returns:
the CutBondReviser object
Throws:
java.io.IOException - on configuration error

init

protected void init(org.dom4j.Element element,
                    Standardizer standardizer,
                    java.lang.String dir)
             throws java.io.IOException
Initializes the reviser.

Parameters:
element - is the configuration DOM element node
standardizer - is the standardizer object
dir - is the molecule file root directory
Throws:
java.io.IOException - on configuration error

setFragmenter

protected void setFragmenter(Fragmenter fragmenter)
Sets the fragmenter. Called by the Fragmenter object with self-reference.

Parameters:
fragmenter - is the fragmenter object

setMolecule

protected void setMolecule(Molecule mol)
                    throws chemaxon.sss.search.SearchException
Sets the input molecule. Called by the fragmenter.

Parameters:
mol - is the input molecule
Throws:
chemaxon.sss.search.SearchException - on error

getMolecule

protected Molecule getMolecule()
Returns the input molecule. Called by the fragmenter.

Returns:
the input molecule

revise

public boolean revise(int a1,
                      int a2)
Returns true if the cut-bond is accepted, false otherwise. Call Fragmenter.isCutBond(int,int) to check for already stored cut-bonds. The default implementation accepts all non-ring cut-bonds.

Parameters:
a1 - is the first atom index of the cut-bond
a2 - is the second atom index of the cut-bond
Returns:
whether the cut-bond is accepted

set

public void set(int a1,
                int a2)
Sets cut-bond. Called when the cut-bond is accepted and stored in the fragmenter. The default implementation does nothing.

Parameters:
a1 - is the first atom of the cut-bond
a2 - is the second atom of the cut-bond

clear

public void clear(int a1,
                  int a2)
Clears cut-bond. Called when backtracking in the exhaustive case. The default implementation does nothing.

Parameters:
a1 - is the first atom of the cut-bond
a2 - is the second atom of the cut-bond