toxTree.tree.rules
Class RuleElements

java.lang.Object
  extended by java.util.Observable
      extended by toxTree.tree.AbstractRule
          extended by toxTree.tree.rules.RuleElements
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IDecisionRule, XMLSerializable
Direct Known Subclasses:
RuleAllAllowedElements, RuleElementsCounter, RuleHasOtherThanC_H_O_N_S2

public class RuleElements
extends AbstractRule

Verifies if the molecule consists of only allowed elements

Author:
Nina Jeliazkova Modified 2005-8-14
See Also:
Serialized Form

Field Summary
static java.lang.String[] comparison
           
protected  SmartElementsList elements
           
protected  int mode
           
static int modeAllSpecifiedElements
           
static int modeAnySpecifiedElements
           
static int modeOnlySpecifiedElements
           
 
Fields inherited from class toxTree.tree.AbstractRule
changes, editable, ERR_STRUCTURENOTPREPROCESSED, examples, explanation, id, logger, MSG_NO, MSG_YES, no, residueIDHidden, title
 
Fields inherited from interface toxTree.core.XMLSerializable
xmltag_CATEGORIES, xmltag_CATEGORY, xmltag_CATEGORYTHRESHOLD, xmltag_CLASS, xmltag_EXPLANATION, xmltag_ID, xmltag_METHOD, xmltag_METHODPARAMETER, xmltag_METHODS, xmltag_NAME, xmltag_RULE, xmltag_RULEEXAMPLE, xmltag_RULES, xmltag_TREEROOT
 
Constructor Summary
RuleElements()
           
 
Method Summary
 void addElement(java.lang.String element)
           
 boolean contains(java.lang.String element)
          IDecisionRule.verifyRule(IAtomContainer)
 boolean equals(java.lang.Object obj)
           
 SmartElementsList getElements()
           
 java.util.HashSet gethalogens()
           
 int getMode()
           
 ambit2.base.interfaces.IProcessor<org.openscience.cdk.interfaces.IAtomContainer,org.openscience.cdk.renderer.selection.IChemObjectSelection> getSelector()
           
 java.lang.String getTitle()
          Rule name is an arbitrary string, preferably one line, reflecting the essence of the rule
(e.g.
 boolean hasOnlySpecifiedElements()
           
 boolean isImplemented()
           
 void removeElement(java.lang.String element)
           
 void select(org.openscience.cdk.interfaces.IAtomContainer mol, org.openscience.cdk.interfaces.IAtomContainer selected)
           
 void setComparisonMode(int mode)
           
 void setElements(SmartElementsList elements)
           
 void setHalogens(java.util.HashSet halogens)
           
 void setHalogens(java.lang.String[] halogens)
           
 void setMode(int mode)
           
 boolean verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol)
          This is the core of a IDecisionRule behaviour.
 boolean verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol, org.openscience.cdk.interfaces.IAtomContainer selected)
           
 
Methods inherited from class toxTree.tree.AbstractRule
addPropertyChangeListener, clearFlags, clone, createRule, fromXML, getEditor, getExampleMolecule, getExamples, getExplanation, getID, getNum, hideResiduesID, isEditable, isResidueIDHidden, log, log, log, makeMolecule, removePropertyChangeListener, setEditable, setExampleMolecule, setExamples, setExplanation, setID, setNum, setTitle, toShallowXML, toString, toXML
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

comparison

public static java.lang.String[] comparison

modeOnlySpecifiedElements

public static final int modeOnlySpecifiedElements
See Also:
Constant Field Values

modeAllSpecifiedElements

public static final int modeAllSpecifiedElements
See Also:
Constant Field Values

modeAnySpecifiedElements

public static final int modeAnySpecifiedElements
See Also:
Constant Field Values

elements

protected SmartElementsList elements

mode

protected int mode
Constructor Detail

RuleElements

public RuleElements()
Method Detail

setHalogens

public void setHalogens(java.lang.String[] halogens)

setHalogens

public void setHalogens(java.util.HashSet halogens)

gethalogens

public java.util.HashSet gethalogens()

isImplemented

public boolean isImplemented()
Specified by:
isImplemented in interface IDecisionRule
Overrides:
isImplemented in class AbstractRule
Returns:
false if the rule is not implemented and true if it is

hasOnlySpecifiedElements

public boolean hasOnlySpecifiedElements()
Returns:
Returns the hasOnlySpecifiedElements.

setComparisonMode

public void setComparisonMode(int mode)
Parameters:
hasOnlySpecifiedElements - The hasOnlySpecifiedElements to set.

getTitle

public java.lang.String getTitle()
Description copied from interface: IDecisionRule
Rule name is an arbitrary string, preferably one line, reflecting the essence of the rule
(e.g. "Is aromatic")

Specified by:
getTitle in interface IDecisionRule
Overrides:
getTitle in class AbstractRule
Returns:
rule name
See Also:
IDecisionRule.getTitle()

addElement

public void addElement(java.lang.String element)

removeElement

public void removeElement(java.lang.String element)

contains

public boolean contains(java.lang.String element)
IDecisionRule.verifyRule(IAtomContainer)


verifyRule

public boolean verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol)
                   throws DecisionMethodException
Description copied from interface: IDecisionRule
This is the core of a IDecisionRule behaviour. The method returns true if the answer of the rule is YES for the analyzed molecule org.openscience.cdk.interfaces.AtomContainer and FALSE if the answer of the rule is NO for the analyzed molecule org.openscience.cdk.interfaces.AtomContainer??

Parameters:
mol - org.openscience.cdk.interfaces.AtomContainer
Returns:
rule result, boolean
Throws:
DecisionMethodException

verifyRule

public boolean verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol,
                          org.openscience.cdk.interfaces.IAtomContainer selected)
                   throws DecisionMethodException
Throws:
DecisionMethodException

select

public void select(org.openscience.cdk.interfaces.IAtomContainer mol,
                   org.openscience.cdk.interfaces.IAtomContainer selected)

equals

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

getElements

public SmartElementsList getElements()

setElements

public void setElements(SmartElementsList elements)

getMode

public int getMode()

setMode

public void setMode(int mode)

getSelector

public ambit2.base.interfaces.IProcessor<org.openscience.cdk.interfaces.IAtomContainer,org.openscience.cdk.renderer.selection.IChemObjectSelection> getSelector()
Specified by:
getSelector in interface IDecisionRule
Overrides:
getSelector in class AbstractRule


Copyright © 2004-2012 Ideaconsult Ltd.. All Rights Reserved.