chemaxon.checkers
Class ValencePropertyChecker

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

public class ValencePropertyChecker
extends AtomChecker

A descendant of AtomChecker detecting atoms having an explicitly set valence property.

Since:
Marvin 5.6
Version:
5.7
Author:
Gyorgy Pirok, Attila Szabo

Field Summary
static java.lang.String PROPERTY_KEY_DEFAULT_VALENCE
          Search for valence properties that are equal to the default valence.
static java.lang.String PROPERTY_KEY_NON_DEFAULT_VALENCE
          Search for valence properties that are not equal to the default valence.
static java.lang.String PROPERTY_KEY_SEARCH_DEFAULT_VALENCE
          Search default valence property
static java.lang.String PROPERTY_KEY_SEARCH_NON_DEFAULT_VALENCE
          Search non default valence property
 
Fields inherited from class chemaxon.checkers.AbstractStructureChecker
errorType, propertyChangeSupport
 
Fields inherited from interface chemaxon.checkers.StructureChecker
PROPERTY_KEY_VALID
 
Constructor Summary
ValencePropertyChecker()
          Creates a new ValencePropertyChecker instance.
ValencePropertyChecker(java.util.Map<java.lang.String,java.lang.String> params)
          Creates a new ValencePropertyChecker instance.
 
Method Summary
protected  boolean check(Molecule molecule, MolAtom component)
          Checks if the component with index i has problem
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean isSearchDefaultValence()
          Returns if the checker detects valence properties with the default valence of the current atom type.
 boolean isSearchNonDefaultValence()
          Returns if the checker detects valence properties with a non-default valence of the current atom type.
 void setSearchDefaultValence(boolean value)
          Sets checker to detect valence properties with the default valence of the current atom type.
 void setSearchNonDefaultValence(boolean value)
          Sets checker to detect valence properties with non-default valence of the current atom type.
 
Methods inherited from class chemaxon.checkers.AtomChecker
createResult, getComponent, getComponentCount
 
Methods inherited from class chemaxon.checkers.ComponentChecker
check1, initialize
 
Methods inherited from class chemaxon.checkers.AbstractStructureChecker
addPropertyChangeListener, addPropertyChangeListener, check, clone, cloneItem, convertResult, expandMolecule, getDescription, getDescriptor, getEditorClassName, getErrorCode, getErrorDescription, getErrorType, getHelpText, getIcon, getLocalMenuName, getName, 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_DEFAULT_VALENCE

public static final java.lang.String PROPERTY_KEY_DEFAULT_VALENCE
Search for valence properties that are equal to the default valence. These might be unnecessary.

See Also:
Constant Field Values

PROPERTY_KEY_NON_DEFAULT_VALENCE

public static final java.lang.String PROPERTY_KEY_NON_DEFAULT_VALENCE
Search for valence properties that are not equal to the default valence.

See Also:
Constant Field Values

PROPERTY_KEY_SEARCH_DEFAULT_VALENCE

public static final java.lang.String PROPERTY_KEY_SEARCH_DEFAULT_VALENCE
Search default valence property

See Also:
Constant Field Values

PROPERTY_KEY_SEARCH_NON_DEFAULT_VALENCE

public static final java.lang.String PROPERTY_KEY_SEARCH_NON_DEFAULT_VALENCE
Search non default valence property

See Also:
Constant Field Values
Constructor Detail

ValencePropertyChecker

public ValencePropertyChecker()
Creates a new ValencePropertyChecker instance.


ValencePropertyChecker

public ValencePropertyChecker(java.util.Map<java.lang.String,java.lang.String> params)
Creates a new ValencePropertyChecker instance. If "default" parameter is given, and its value is "true" then it detects atoms having a valence property that is equal to the default valence of the current atom type. If "non-default" parameter given, and its value is "true" then it detects atoms having a valence property that is not equal to the default valence of the current atom type.

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

check

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

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractStructureChecker

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractStructureChecker

isSearchDefaultValence

public boolean isSearchDefaultValence()
Returns if the checker detects valence properties with the default valence of the current atom type.

Returns:
true if the checker detects default valence properties

isSearchNonDefaultValence

public boolean isSearchNonDefaultValence()
Returns if the checker detects valence properties with a non-default valence of the current atom type.

Returns:
true if the checker detects non-default valence properties

setSearchDefaultValence

public void setSearchDefaultValence(boolean value)
Sets checker to detect valence properties with the default valence of the current atom type.

Parameters:
value - if true, the checker will detect atoms with default valence properties, otherwise not

setSearchNonDefaultValence

public void setSearchNonDefaultValence(boolean value)
Sets checker to detect valence properties with non-default valence of the current atom type.

Parameters:
value - if true, the checker will detect atoms with non-default valence properties, otherwise not