chemaxon.checkers
Class BondLengthChecker

java.lang.Object
  extended by chemaxon.checkers.AbstractStructureChecker
      extended by chemaxon.checkers.ComponentChecker<MolBond>
          extended by chemaxon.checkers.BondChecker
              extended by chemaxon.checkers.BondLengthChecker
All Implemented Interfaces:
StructureChecker, chemaxon.license.Licensable, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

public class BondLengthChecker
extends BondChecker

A descendant of BondChecker detecting bonds with unpreferred lengths in 2D molecule layouts.

Since:
Marvin 5.3
Version:
5.7
Author:
Attila Szabo

Field Summary
static java.lang.String PROPERTY_KEY_DETECT_TOO_LONG_BONDS
          This public constant String represents the name of the property which is responsible for searching too long bonds in the molecule
static java.lang.String PROPERTY_KEY_DETECT_TOO_SHORT_BONDS
          This public constant String represents the name of the property which is responsible for searching too short bonds in the molecule
static java.lang.String PROPERTY_KEY_LONG
          This public constant String represents the name of the configuration file property which is responsible for searching too long bonds in the molecule
static java.lang.String PROPERTY_KEY_SHORT
          This public constant String represents the name of the configuration file property which is responsible for searching too short bonds in the molecule
 
Fields inherited from class chemaxon.checkers.AbstractStructureChecker
errorType, propertyChangeSupport
 
Fields inherited from interface chemaxon.checkers.StructureChecker
PROPERTY_KEY_VALID
 
Constructor Summary
BondLengthChecker()
          Default constructor
BondLengthChecker(java.util.Map<java.lang.String,java.lang.String> params)
          Parameterized constructor.
 
Method Summary
protected  boolean check(Molecule molecule, MolBond bond)
          Checks if the component with index i has problem
protected  StructureCheckerResult check1(Molecule molecule)
          Iterates through the components and checks every component.
 boolean isDetectTooLongBonds()
           
 boolean isDetectTooShortBonds()
           
 void setDetectTooLongBonds(boolean detectTooLongBonds)
          Sets if the checker should check for too long bonds or not
 void setDetectTooShortBonds(boolean detectTooShortBonds)
          Sets if the checker should check for too short bonds or not
 
Methods inherited from class chemaxon.checkers.BondChecker
createResult, getComponent, getComponentCount
 
Methods inherited from class chemaxon.checkers.ComponentChecker
initialize
 
Methods inherited from class chemaxon.checkers.AbstractStructureChecker
addPropertyChangeListener, addPropertyChangeListener, check, clone, cloneItem, convertResult, equals, expandMolecule, getDescription, getDescriptor, getEditorClassName, getErrorCode, getErrorDescription, getErrorType, getHelpText, getIcon, getLocalMenuName, getName, hashCode, isAvailable, isLicensed, isValid, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setDescription, setHelpText, setIcon, setLicenseEnvironment, setLocalMenuName, setMoreErrorMessage, setName, setNoErrorMessage, setOneErrorMessage, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_KEY_SHORT

public static final java.lang.String PROPERTY_KEY_SHORT
This public constant String represents the name of the configuration file property which is responsible for searching too short bonds in the molecule

Since:
5.4
See Also:
Constant Field Values

PROPERTY_KEY_LONG

public static final java.lang.String PROPERTY_KEY_LONG
This public constant String represents the name of the configuration file property which is responsible for searching too long bonds in the molecule

Since:
5.4
See Also:
Constant Field Values

PROPERTY_KEY_DETECT_TOO_LONG_BONDS

public static final java.lang.String PROPERTY_KEY_DETECT_TOO_LONG_BONDS
This public constant String represents the name of the property which is responsible for searching too long bonds in the molecule

Since:
5.7
See Also:
Constant Field Values

PROPERTY_KEY_DETECT_TOO_SHORT_BONDS

public static final java.lang.String PROPERTY_KEY_DETECT_TOO_SHORT_BONDS
This public constant String represents the name of the property which is responsible for searching too short bonds in the molecule

Since:
5.7
See Also:
Constant Field Values
Constructor Detail

BondLengthChecker

public BondLengthChecker()
Default constructor


BondLengthChecker

public BondLengthChecker(java.util.Map<java.lang.String,java.lang.String> params)
Parameterized constructor. If "short" parameter is given and its value is "true" too short bonds will be detected during the checking mechanism If "long" parameter is given and its value is "true" too long bonds will be detected during the checking mechanism

Parameters:
params - a Map instance which contains String pairs. Key is the name of the parameter.
Method Detail

setDetectTooLongBonds

public void setDetectTooLongBonds(boolean detectTooLongBonds)
Sets if the checker should check for too long bonds or not

Parameters:
detectTooLongBonds - is a boolean instance
Since:
5.4

setDetectTooShortBonds

public void setDetectTooShortBonds(boolean detectTooShortBonds)
Sets if the checker should check for too short bonds or not

Parameters:
detectTooShortBonds - is a boolean instance
Since:
5.4

isDetectTooLongBonds

public boolean isDetectTooLongBonds()
Returns:
the detectTooLongBonds

isDetectTooShortBonds

public boolean isDetectTooShortBonds()
Returns:
the detectTooShortBonds

check1

protected StructureCheckerResult check1(Molecule molecule)
Description copied from class: ComponentChecker
Iterates through the components and checks every component. If a component has error it is added to a List. After the iteration if no problem occurred the result is null otherwise the method creates a StructureCheckerResult containing the atoms and bonds of the problematic components.

Overrides:
check1 in class ComponentChecker<MolBond>
Parameters:
molecule - the Molecule instance to be checked for problems
Returns:
a StructureCheckerResult which contains all the indices of the problematic components

check

protected boolean check(Molecule molecule,
                        MolBond bond)
Description copied from class: ComponentChecker
Checks if the component with index i has problem

Specified by:
check in class ComponentChecker<MolBond>
Parameters:
molecule - is a Molecule instance
bond - the current component to check
Returns:
true if the component has problem, false otherwise