E
- is the type of the component (for example: MolAtom, MolBond, etc...)public abstract class ComponentChecker<E> extends AbstractStructureChecker
errorType, propertyChangeSupport
PROPERTY_KEY_VALID
Constructor and Description |
---|
ComponentChecker(StructureCheckerErrorType errorType)
Constructor to create a Structure checker instance with the given errorType.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
check(Molecule molecule,
E component)
Checks if the component with index i has problem
|
protected StructureCheckerResult |
check1(Molecule molecule)
Iterates through the components and checks every component.
|
protected abstract StructureCheckerResult |
createResult(Molecule molecule,
List<E> componentList)
Creates a
StructureCheckerResult from a List containing the components. |
protected abstract E |
getComponent(Molecule molecule,
int i)
Gets the component from the molecule with index i.
|
protected abstract int |
getComponentCount(Molecule molecule)
Gets the number of the components in the molecule
|
protected void |
initialize()
Empty default implementation
|
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
public ComponentChecker(StructureCheckerErrorType errorType)
errorType
- element of StructureCheckerErrorType
protected abstract int getComponentCount(Molecule molecule)
molecule
- the molecule to checkprotected abstract E getComponent(Molecule molecule, int i)
molecule
- the molecule to checki
- the index of the componentprotected void initialize()
protected StructureCheckerResult check1(Molecule molecule)
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.check1
in class AbstractStructureChecker
molecule
- the Molecule
instance to be checked for problemsStructureCheckerResult
which contains all the indices of the problematic componentsprotected abstract StructureCheckerResult createResult(Molecule molecule, List<E> componentList)
StructureCheckerResult
from a List
containing the components.molecule
- is a Molecule
instancecomponentList
- is an instance of List
containing the problematic componentsStructureCheckerResult
containing all problematic component indices