Package chemaxon.checkers
Class ComponentChecker<E>
java.lang.Object
chemaxon.checkers.AbstractStructureChecker
chemaxon.checkers.ComponentChecker<E>
- Type Parameters:
E- is the type of the component (for example: MolAtom, MolBond, etc...)
- All Implemented Interfaces:
StructureChecker,chemaxon.license.Licensable,PropertyChangeListener,Cloneable,EventListener
- Direct Known Subclasses:
AtomChecker,BondChecker
Descendants of the abstract ComponentChecker class implement detect problems related to
disconnected components (fragments).
- Since:
- Marvin 5.3
-
Field Summary
Fields inherited from class chemaxon.checkers.AbstractStructureChecker
errorType, propertyChangeSupportFields inherited from interface chemaxon.checkers.StructureChecker
PROPERTY_KEY_VALID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComponentChecker(StructureCheckerErrorType errorType) Constructor to create a Structure checker instance with the given errorType. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanChecks if the component with index i has problemprotected StructureCheckerResultIterates through the components and checks every component.protected abstract StructureCheckerResultcreateResult(Molecule molecule, List<E> componentList) Creates aStructureCheckerResultfrom aListcontaining the components.protected abstract EgetComponent(Molecule molecule, int i) Gets the component from the molecule with index i.protected abstract intgetComponentCount(Molecule molecule) Gets the number of the components in the moleculeprotected voidEmpty default implementationMethods 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
-
Constructor Details
-
ComponentChecker
Constructor to create a Structure checker instance with the given errorType.- Parameters:
errorType- element ofStructureCheckerErrorType
-
-
Method Details
-
getComponentCount
Gets the number of the components in the molecule- Parameters:
molecule- the molecule to check- Returns:
- the number of the components in the molecule
-
getComponent
Gets the component from the molecule with index i.- Parameters:
molecule- the molecule to checki- the index of the component- Returns:
- the component
-
initialize
protected void initialize()Empty default implementation -
check1
Iterates through the components and checks every component. If a component has error it is added to aList. After the iteration if no problem occurred the result is null otherwise the method creates aStructureCheckerResultcontaining the atoms and bonds of the problematic components.- Specified by:
check1in classAbstractStructureChecker- Parameters:
molecule- theMoleculeinstance to be checked for problems- Returns:
- a
StructureCheckerResultwhich contains all the indices of the problematic components
-
createResult
Creates aStructureCheckerResultfrom aListcontaining the components.- Parameters:
molecule- is aMoleculeinstancecomponentList- is an instance ofListcontaining the problematic components- Returns:
- a
StructureCheckerResultcontaining all problematic component indices
-
check
Checks if the component with index i has problem- Parameters:
molecule- is aMoleculeinstancecomponent- the current component to check- Returns:
- true if the component has problem, false otherwise
-