toxTree.tree
Class AbstractRule

java.lang.Object
  extended by java.util.Observable
      extended by toxTree.tree.AbstractRule
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IDecisionRule, XMLSerializable
Direct Known Subclasses:
AbstractRuleHilightHits, AbstractRuleSmartSubstructure, Find, KroesRule8, LinearDiscriminantRule, MetaboliteGenerator, Rule13_AliphaticMonoalcohols, Rule3MemberedHeterocycle, RuleAnySubstituents, RuleDescriptor, RuleElements, RuleHeterocyclic, RuleKetoneAlcoholEtc, RuleManyAromaticRings, RuleOpenChain, RuleStructuresList, RuleSufficientSulphonateGroups, RuleTwoOrMoreRings, RuleVerifyProperty, UserInputRule

public abstract class AbstractRule
extends java.util.Observable
implements IDecisionRule, XMLSerializable

An abstract class implementing IDecisionRule interface. Used as a base class for all rules in ToxTreeApp application.

Version:
0.1, 2005-5-2
Author:
Nina Jeliazkova
See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
protected  boolean editable
           
static java.lang.String ERR_STRUCTURENOTPREPROCESSED
           
protected  java.lang.String[] examples
           
protected  java.lang.StringBuffer explanation
           
protected  java.lang.String id
           
protected static TTLogger logger
           
static java.lang.String MSG_NO
           
static java.lang.String MSG_YES
           
protected  int no
           
protected  boolean residueIDHidden
           
protected  java.lang.String 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
AbstractRule()
          Constructor
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void clearFlags(org.openscience.cdk.interfaces.IAtomContainer mol)
          When rules analyze a molecule, a set of properties are set.
 java.lang.Object clone()
           
static IDecisionRule createRule(java.lang.String className)
           
 boolean equals(java.lang.Object obj)
           
 void fromXML(org.w3c.dom.Element xml)
           
 IDecisionRuleEditor getEditor()
          See IDecisionRule.getEditor()
 org.openscience.cdk.interfaces.IMolecule getExampleMolecule(boolean ruleResult)
          if ruleResult is TRUE, returns the example molecule if the rule is answered YES if ruleResult is FALSE, returns the example molecule if the rule is answered NO
 java.lang.String[] getExamples()
           
 java.lang.String getExplanation()
          Rule explanation is an arbitrary text, could be multiline and may contain html tags.
 java.lang.String getID()
          Rule identifier is an arbitrary string, preferably short one
 int getNum()
           
 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.
 void hideResiduesID(boolean hide)
           
 boolean isEditable()
           
 boolean isImplemented()
           
 boolean isResidueIDHidden()
           
protected  void log(java.util.logging.Level level, java.lang.String message)
           
protected  void log(java.util.logging.Level level, java.lang.String message, java.lang.Object param)
           
protected  void log(java.util.logging.Level level, java.lang.String message, java.lang.Object[] params)
           
static org.openscience.cdk.interfaces.IMolecule makeMolecule(boolean yes)
          This is to ensure each derived class will provide an example of a molecule which resolves to the yes and no rule outcome
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void setEditable(boolean value)
           
 void setExampleMolecule(org.openscience.cdk.interfaces.IAtomContainer mol, boolean ruleResult)
          Sets example molecule for the YES or NO answer of the rule
 void setExamples(java.lang.String[] examples)
           
 void setExplanation(java.lang.String message)
          Sets rule explanation
 void setID(java.lang.String id)
          Sets rule identifier
 void setNum(int no)
           
 void setTitle(java.lang.String name)
          Sets rule name
 org.w3c.dom.Element toShallowXML(org.w3c.dom.Document document)
           
 java.lang.String toString()
           
 org.w3c.dom.Element toXML(org.w3c.dom.Document document)
           
 
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
 
Methods inherited from interface toxTree.core.IDecisionRule
verifyRule
 

Field Detail

ERR_STRUCTURENOTPREPROCESSED

public static transient java.lang.String ERR_STRUCTURENOTPREPROCESSED

MSG_YES

public static transient java.lang.String MSG_YES

MSG_NO

public static transient java.lang.String MSG_NO

logger

protected static transient TTLogger logger

changes

protected transient java.beans.PropertyChangeSupport changes

title

protected java.lang.String title

explanation

protected java.lang.StringBuffer explanation

id

protected java.lang.String id

no

protected int no

examples

protected java.lang.String[] examples

residueIDHidden

protected boolean residueIDHidden

editable

protected boolean editable
Constructor Detail

AbstractRule

public AbstractRule()
Constructor

Method Detail

getID

public java.lang.String getID()
Description copied from interface: IDecisionRule
Rule identifier is an arbitrary string, preferably short one

Specified by:
getID in interface IDecisionRule
Returns:
the rule identifier
See Also:
IDecisionRule.getID()

setID

public void setID(java.lang.String id)
Description copied from interface: IDecisionRule
Sets rule identifier

Specified by:
setID in interface IDecisionRule
See Also:
IDecisionRule.setID(String)

getNum

public int getNum()
Specified by:
getNum in interface IDecisionRule

setNum

public void setNum(int no)
Specified by:
setNum in interface IDecisionRule

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
Returns:
rule name
See Also:
IDecisionRule.getTitle()

setTitle

public void setTitle(java.lang.String name)
Description copied from interface: IDecisionRule
Sets rule name

Specified by:
setTitle in interface IDecisionRule
See Also:
IDecisionRule.setTitle(java.lang.String)

getExplanation

public java.lang.String getExplanation()
Description copied from interface: IDecisionRule
Rule explanation is an arbitrary text, could be multiline and may contain html tags.

Specified by:
getExplanation in interface IDecisionRule
Returns:
explanation
See Also:
IDecisionRule.getExplanation()

setExplanation

public void setExplanation(java.lang.String message)
Description copied from interface: IDecisionRule
Sets rule explanation

Specified by:
setExplanation in interface IDecisionRule
See Also:
IDecisionRule.setExplanation(java.lang.String)

isImplemented

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

toString

public java.lang.String toString()
Specified by:
toString in interface IDecisionRule
Overrides:
toString in class java.lang.Object

createRule

public static IDecisionRule createRule(java.lang.String className)
                                throws DecisionMethodException
Throws:
DecisionMethodException

makeMolecule

public static org.openscience.cdk.interfaces.IMolecule makeMolecule(boolean yes)
                                                             throws DecisionMethodException
This is to ensure each derived class will provide an example of a molecule which resolves to the yes and no rule outcome

Parameters:
yes -
Returns:
org.openscience.cdk.interfaces.Molecule
Throws:
DecisionMethodException

setExampleMolecule

public void setExampleMolecule(org.openscience.cdk.interfaces.IAtomContainer mol,
                               boolean ruleResult)
Description copied from interface: IDecisionRule
Sets example molecule for the YES or NO answer of the rule

Specified by:
setExampleMolecule in interface IDecisionRule
Parameters:
mol - org.openscience.cdk.interfaces.Molecule

getExampleMolecule

public org.openscience.cdk.interfaces.IMolecule getExampleMolecule(boolean ruleResult)
                                                            throws DecisionMethodException
Description copied from interface: IDecisionRule
if ruleResult is TRUE, returns the example molecule if the rule is answered YES if ruleResult is FALSE, returns the example molecule if the rule is answered NO

Specified by:
getExampleMolecule in interface IDecisionRule
Returns:
org.openscience.cdk.interfaces.Molecule
Throws:
DecisionMethodException

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface IDecisionRule

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface IDecisionRule

equals

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

clearFlags

public void clearFlags(org.openscience.cdk.interfaces.IAtomContainer mol)
Description copied from interface: IDecisionRule
When rules analyze a molecule, a set of properties are set. This method provides a way to clear the properties. Could be moved in a different class in a later release

Specified by:
clearFlags in interface IDecisionRule
Parameters:
mol - org.openscience.cdk.interfaces.Molecule

hideResiduesID

public void hideResiduesID(boolean hide)
Specified by:
hideResiduesID in interface IDecisionRule

isResidueIDHidden

public boolean isResidueIDHidden()
Specified by:
isResidueIDHidden in interface IDecisionRule

getEditor

public IDecisionRuleEditor getEditor()
See IDecisionRule.getEditor()

Specified by:
getEditor in interface IDecisionRule
Returns:
IDecisionRuleEditor

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface IDecisionRule
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

isEditable

public boolean isEditable()
Specified by:
isEditable in interface IDecisionRule

setEditable

public void setEditable(boolean value)
Specified by:
setEditable in interface IDecisionRule

fromXML

public void fromXML(org.w3c.dom.Element xml)
             throws XMLDecisionMethodException
Specified by:
fromXML in interface XMLSerializable
Throws:
XMLDecisionMethodException

toShallowXML

public org.w3c.dom.Element toShallowXML(org.w3c.dom.Document document)
                                 throws XMLDecisionMethodException
Specified by:
toShallowXML in interface XMLSerializable
Throws:
XMLDecisionMethodException

toXML

public org.w3c.dom.Element toXML(org.w3c.dom.Document document)
                          throws XMLDecisionMethodException
Specified by:
toXML in interface XMLSerializable
Throws:
XMLDecisionMethodException

getExamples

public java.lang.String[] getExamples()

setExamples

public void setExamples(java.lang.String[] examples)

getSelector

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

log

protected void log(java.util.logging.Level level,
                   java.lang.String message)

log

protected void log(java.util.logging.Level level,
                   java.lang.String message,
                   java.lang.Object param)

log

protected void log(java.util.logging.Level level,
                   java.lang.String message,
                   java.lang.Object[] params)


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