|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
toxTree.tree.AbstractTree
public abstract class AbstractTree
An astract class, implementing IDecisionMethod
interface.
Used as a base class for the decision trees in ToxTreeApp
.
The default editor is TreeEditorPanel
.
Field Summary | |
---|---|
protected IDecisionCategories |
categories
|
protected java.beans.PropertyChangeSupport |
changes
|
protected java.lang.String |
explanation
|
protected boolean |
falseIfRuleNotImplemented
|
protected java.awt.Dimension |
imageSize
|
protected static TTLogger |
logger
|
protected boolean |
modified
|
protected java.lang.String |
name
|
protected int |
priority
|
protected IDecisionRuleList |
rules
|
protected int |
treeRoot
|
protected boolean |
web
|
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 | |
---|---|
AbstractTree()
Constructor |
|
AbstractTree(IDecisionCategories categories)
|
|
AbstractTree(IDecisionCategories categories,
IDecisionRuleList rules)
|
Method Summary | |
---|---|
void |
addDecisionRule(IDecisionRule rule)
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
|
boolean |
classify(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result)
|
protected void |
clearChanged()
|
IDecisionResult |
createDecisionResult()
|
boolean |
equals(java.lang.Object obj)
|
java.lang.StringBuffer |
explainRules(IDecisionResult result,
boolean verbose)
|
void |
fromXML(org.w3c.dom.Element xml)
|
IDecisionCategories |
getCategories()
|
IDecisionMethodEditor |
getEditor()
Each rule provides an editor, which is a class implementing IDecisionMethodEditor . |
java.lang.String |
getExplanation()
|
java.awt.image.BufferedImage |
getImage(org.openscience.cdk.interfaces.IAtomContainer mol)
|
java.awt.image.BufferedImage |
getImage(org.openscience.cdk.interfaces.IAtomContainer mol,
java.lang.String ruleID,
int width,
int height,
boolean atomnumbers)
|
java.awt.Dimension |
getImageSize()
|
java.awt.image.BufferedImage |
getLegend(int width,
int height)
|
int |
getNumberOfClasses()
|
int |
getNumberOfRules()
|
int |
getPriority()
|
IDecisionRule |
getRule(int id)
|
IDecisionRule |
getRule(java.lang.String name)
|
IDecisionRuleList |
getRules()
|
java.lang.String |
getTitle()
returns the decision tree title (e.g. |
IDecisionRule |
getTopRule()
|
protected abstract IDecisionRuleList |
initRules()
public AbstractTree( IDecisionCategories classes, String[] customRules, int[][] customTransitions) throws DecisionMethodException { this(categories,customRules,customTransitions); } public AbstractTree( String[] customRules, int[][] customTransitions) throws DecisionMethodException { this(); setRules(customRules); setTransitions(customTransitions); setChanged(); notifyObservers(); } |
boolean |
isFalseIfRuleNotImplemented()
|
boolean |
isModified()
|
boolean |
isWeb()
|
javax.swing.JComponent |
optionsPanel(org.openscience.cdk.interfaces.IAtomContainer atomContainer)
|
void |
printResults(java.lang.String filename)
|
void |
printToStream(java.io.OutputStream os)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
|
protected java.lang.String |
retrieveExplanation(java.lang.String resourceBundle)
|
void |
setCategories(IDecisionCategories categories)
|
protected void |
setChanged()
|
void |
setDecisionRule(IDecisionRule rule)
|
void |
setExplanation(java.lang.String explanation)
|
void |
setFalseIfRuleNotImplemented(boolean falseIfRuleNotImplemented)
|
void |
setImageSize(java.awt.Dimension imageSize)
|
void |
setModified(boolean value)
|
abstract void |
setParameters(org.openscience.cdk.interfaces.IAtomContainer mol)
Can be used to display some options before applying the rules. |
void |
setPriority(int priority)
|
void |
setRules(IDecisionRuleList rules)
|
protected void |
setRules(java.lang.String[] customRules)
|
void |
setTitle(java.lang.String value)
sets decision tree title (e.g. |
protected abstract void |
setTransitions(int[][] customTransitions)
|
void |
setWeb(java.lang.Boolean web)
|
int |
testRulesWithSelector()
|
org.w3c.dom.Element |
toShallowXML(org.w3c.dom.Document document)
|
java.lang.String |
toString()
|
org.w3c.dom.Element |
toXML(org.w3c.dom.Document document)
|
void |
update(java.util.Observable o,
java.lang.Object arg)
|
protected boolean |
verifyResidues(org.openscience.cdk.interfaces.IAtomContainerSet mols,
IDecisionResult result,
IDecisionRule rule)
|
boolean |
verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result)
IDecisionRule.verifyRule(IAtomContainer) |
protected abstract boolean |
verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result,
IDecisionRule rule)
abstract method, to be implemented in the child class |
protected void |
walkRules(IDecisionRule rule,
java.util.ArrayList<java.lang.Integer> visited,
IProcessRule processor)
|
void |
walkRules(IDecisionRule rule,
IProcessRule processor)
|
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface toxTree.core.IDecisionMethod |
---|
getBranch, getCategory, hasUnreachableRules, hasUnusedCategories, isEditable, setEditable |
Field Detail |
---|
protected static transient TTLogger logger
protected java.awt.Dimension imageSize
protected boolean web
protected transient java.beans.PropertyChangeSupport changes
protected IDecisionRuleList rules
protected IDecisionCategories categories
protected boolean falseIfRuleNotImplemented
protected int treeRoot
protected java.lang.String name
protected java.lang.String explanation
protected transient boolean modified
protected int priority
Constructor Detail |
---|
public AbstractTree()
public AbstractTree(IDecisionCategories categories)
public AbstractTree(IDecisionCategories categories, IDecisionRuleList rules)
Method Detail |
---|
public java.awt.Dimension getImageSize()
getImageSize
in interface ambit2.core.data.IStructureDiagramHighlights
public void setImageSize(java.awt.Dimension imageSize)
setImageSize
in interface ambit2.core.data.IStructureDiagramHighlights
protected abstract IDecisionRuleList initRules()
protected void setRules(java.lang.String[] customRules) throws DecisionMethodException
DecisionMethodException
protected abstract void setTransitions(int[][] customTransitions)
public java.lang.String getTitle()
getTitle
in interface IDecisionMethod
public void setTitle(java.lang.String value)
setTitle
in interface IDecisionMethod
public void addDecisionRule(IDecisionRule rule) throws DecisionMethodException
addDecisionRule
in interface IDecisionMethod
DecisionMethodException
IDecisionMethod.addDecisionRule(toxTree.core.IDecisionRule)
public void setDecisionRule(IDecisionRule rule) throws DecisionMethodException
setDecisionRule
in interface IDecisionMethod
DecisionMethodException
IDecisionMethod.setDecisionRule(toxTree.core.IDecisionRule)
public java.lang.StringBuffer explainRules(IDecisionResult result, boolean verbose) throws DecisionMethodException
explainRules
in interface IDecisionMethod
DecisionMethodException
IDecisionMethod.explainRules(IDecisionResult,boolean)
protected boolean verifyResidues(org.openscience.cdk.interfaces.IAtomContainerSet mols, IDecisionResult result, IDecisionRule rule) throws DecisionMethodException
DecisionMethodException
public boolean verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol, IDecisionResult result) throws DecisionMethodException
IDecisionRule.verifyRule(IAtomContainer)
verifyRules
in interface IDecisionMethod
DecisionMethodException
protected abstract boolean verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol, IDecisionResult result, IDecisionRule rule) throws DecisionMethodException
mol
- - org.openscience.cdk.interfaces.AtomContainer
to be analyzedresult
- - IDecisionResult
the result from the decision tree applicationrule
- - the starting rule
DecisionMethodException
public boolean classify(org.openscience.cdk.interfaces.IAtomContainer mol, IDecisionResult result) throws DecisionMethodException
classify
in interface IDecisionMethod
DecisionMethodException
public abstract void setParameters(org.openscience.cdk.interfaces.IAtomContainer mol)
setParameters
in interface IDecisionMethod
mol
- public javax.swing.JComponent optionsPanel(org.openscience.cdk.interfaces.IAtomContainer atomContainer)
public int getNumberOfRules()
getNumberOfRules
in interface IDecisionMethod
public IDecisionRule getRule(int id)
getRule
in interface IDecisionMethod
IDecisionMethod.getRule(int)
public IDecisionRule getRule(java.lang.String name)
getRule
in interface IDecisionMethod
IDecisionMethod.getRule(java.lang.String)
public void printToStream(java.io.OutputStream os) throws java.io.IOException
os
-
java.io.IOException
public void printResults(java.lang.String filename) throws java.io.IOException
filename
-
java.io.IOException
public boolean isFalseIfRuleNotImplemented()
public void setFalseIfRuleNotImplemented(boolean falseIfRuleNotImplemented)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener
in interface IDecisionMethod
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener
in interface IDecisionMethod
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public IDecisionCategories getCategories()
getCategories
in interface IDecisionMethod
public java.lang.String toString()
toString
in class java.lang.Object
public IDecisionResult createDecisionResult()
createDecisionResult
in interface IDecisionMethod
public int getNumberOfClasses()
getNumberOfClasses
in interface IDecisionMethod
public IDecisionRuleList getRules()
getRules
in interface IDecisionMethod
public java.lang.String getExplanation()
getExplanation
in interface IDecisionMethod
public void setExplanation(java.lang.String explanation)
setExplanation
in interface IDecisionMethod
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public IDecisionRule getTopRule()
getTopRule
in interface IDecisionMethod
protected void setChanged()
setChanged
in class java.util.Observable
protected void clearChanged()
clearChanged
in class java.util.Observable
public boolean isModified()
isModified
in interface IDecisionMethod
public void setModified(boolean value)
setModified
in interface IDecisionMethod
public IDecisionMethodEditor getEditor()
IDecisionMethod
IDecisionMethodEditor
.
The editor shall provide user interface for visualization and modification of various method settings.
getEditor
in interface IDecisionMethod
IDecisionMethodEditor
public void fromXML(org.w3c.dom.Element xml) throws XMLDecisionMethodException
fromXML
in interface XMLSerializable
XMLDecisionMethodException
public org.w3c.dom.Element toShallowXML(org.w3c.dom.Document document) throws XMLDecisionMethodException
toShallowXML
in interface XMLSerializable
XMLDecisionMethodException
public org.w3c.dom.Element toXML(org.w3c.dom.Document document) throws XMLDecisionMethodException
toXML
in interface XMLSerializable
XMLDecisionMethodException
public void setRules(IDecisionRuleList rules)
public void setCategories(IDecisionCategories categories)
public int getPriority()
getPriority
in interface IDecisionMethodPrority
public void setPriority(int priority)
setPriority
in interface IDecisionMethodPrority
public int testRulesWithSelector() throws java.lang.Exception
java.lang.Exception
public void walkRules(IDecisionRule rule, IProcessRule processor) throws DecisionMethodException
walkRules
in interface IDecisionMethod
DecisionMethodException
protected void walkRules(IDecisionRule rule, java.util.ArrayList<java.lang.Integer> visited, IProcessRule processor) throws DecisionMethodException
DecisionMethodException
public java.awt.image.BufferedImage getImage(org.openscience.cdk.interfaces.IAtomContainer mol) throws ambit2.base.exceptions.AmbitException
getImage
in interface ambit2.core.data.IStructureDiagramHighlights
ambit2.base.exceptions.AmbitException
public java.awt.image.BufferedImage getImage(org.openscience.cdk.interfaces.IAtomContainer mol, java.lang.String ruleID, int width, int height, boolean atomnumbers) throws ambit2.base.exceptions.AmbitException
getImage
in interface ambit2.core.data.IStructureDiagramHighlights
ambit2.base.exceptions.AmbitException
public void setWeb(java.lang.Boolean web)
setWeb
in interface IDecisionMethod
public boolean isWeb()
isWeb
in interface IDecisionMethod
public java.awt.image.BufferedImage getLegend(int width, int height) throws ambit2.base.exceptions.AmbitException
getLegend
in interface ambit2.core.data.IStructureDiagramHighlights
ambit2.base.exceptions.AmbitException
protected java.lang.String retrieveExplanation(java.lang.String resourceBundle)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |