public abstract class AbstractTree extends Observable implements IDecisionMethod, Observer, XMLSerializable
IDecisionMethod
interface. Used as a base class for the decision trees in
ToxTreeApp. The default editor is
TreeEditorPanel.| Modifier and Type | Field and Description |
|---|---|
protected IDecisionCategories |
categories |
protected PropertyChangeSupport |
changes |
protected String |
explanation |
protected boolean |
falseIfRuleNotImplemented |
protected Dimension |
imageSize |
protected static Logger |
logger |
protected boolean |
modified |
protected String |
name |
protected int |
priority |
protected IDecisionRuleList |
rules |
protected int |
treeRoot |
protected boolean |
web |
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 and Description |
|---|
AbstractTree()
Constructor
|
AbstractTree(IDecisionCategories categories) |
AbstractTree(IDecisionCategories categories,
IDecisionRuleList rules) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDecisionRule(IDecisionRule rule) |
void |
addPropertyChangeListener(PropertyChangeListener l) |
boolean |
classify(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result) |
protected void |
clearChanged() |
IDecisionResult |
createDecisionResult() |
boolean |
equals(Object obj) |
StringBuffer |
explainRules(IDecisionResult result,
boolean verbose) |
void |
fromXML(Element xml) |
IDecisionCategories |
getCategories() |
IDecisionMethodEditor |
getEditor()
Each rule provides an editor, which is a class implementing
IDecisionMethodEditor. |
String |
getExplanation() |
BufferedImage |
getImage(org.openscience.cdk.interfaces.IAtomContainer mol) |
BufferedImage |
getImage(org.openscience.cdk.interfaces.IAtomContainer mol,
String ruleID,
int width,
int height,
boolean atomnumbers) |
Dimension |
getImageSize() |
BufferedImage |
getLegend(int width,
int height) |
int |
getNumberOfClasses() |
int |
getNumberOfRules() |
int |
getPriority() |
IDecisionRule |
getRule(int id) |
IDecisionRule |
getRule(String name) |
IDecisionRuleList |
getRules() |
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() |
JComponent |
optionsPanel(org.openscience.cdk.interfaces.IAtomContainer atomContainer) |
void |
printResults(String filename) |
void |
printToStream(OutputStream os) |
void |
removePropertyChangeListener(PropertyChangeListener l) |
protected String |
retrieveExplanation(String resourceBundle) |
void |
setCategories(IDecisionCategories categories) |
protected void |
setChanged() |
void |
setDecisionRule(IDecisionRule rule) |
void |
setExplanation(String explanation) |
void |
setFalseIfRuleNotImplemented(boolean falseIfRuleNotImplemented) |
void |
setImageSize(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(String[] customRules) |
void |
setTitle(String value)
sets decision tree title (e.g.
|
protected abstract void |
setTransitions(int[][] customTransitions) |
void |
setWeb(Boolean web) |
int |
testRulesWithSelector() |
Element |
toShallowXML(Document document) |
String |
toString() |
Element |
toXML(Document document) |
void |
update(Observable o,
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)
|
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,
ArrayList<Integer> visited,
IProcessRule processor) |
void |
walkRules(IDecisionRule rule,
IProcessRule processor) |
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObserversclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBranch, getCategory, hasUnreachableRules, hasUnusedCategories, isEditable, setEditableprotected static transient Logger logger
protected Dimension imageSize
protected boolean web
protected transient PropertyChangeSupport changes
protected IDecisionRuleList rules
protected IDecisionCategories categories
protected boolean falseIfRuleNotImplemented
protected int treeRoot
protected String name
protected String explanation
protected transient boolean modified
protected int priority
public AbstractTree()
public AbstractTree(IDecisionCategories categories)
public AbstractTree(IDecisionCategories categories, IDecisionRuleList rules)
public Dimension getImageSize()
getImageSize in interface ambit2.core.data.IStructureDiagramDepiction<BufferedImage>public void setImageSize(Dimension imageSize)
setImageSize in interface ambit2.core.data.IStructureDiagramDepiction<BufferedImage>protected abstract IDecisionRuleList initRules()
protected void setRules(String[] customRules) throws DecisionMethodException
DecisionMethodExceptionprotected abstract void setTransitions(int[][] customTransitions)
public String getTitle()
getTitle in interface IDecisionMethodpublic void setTitle(String value)
setTitle in interface IDecisionMethodpublic void addDecisionRule(IDecisionRule rule) throws DecisionMethodException
addDecisionRule in interface IDecisionMethodDecisionMethodExceptionIDecisionMethod.addDecisionRule(toxTree.core.IDecisionRule)public void setDecisionRule(IDecisionRule rule) throws DecisionMethodException
setDecisionRule in interface IDecisionMethodDecisionMethodExceptionIDecisionMethod.setDecisionRule(toxTree.core.IDecisionRule)public StringBuffer explainRules(IDecisionResult result, boolean verbose) throws DecisionMethodException
explainRules in interface IDecisionMethodDecisionMethodExceptionIDecisionMethod.explainRules(IDecisionResult,boolean)protected boolean verifyResidues(org.openscience.cdk.interfaces.IAtomContainerSet mols,
IDecisionResult result,
IDecisionRule rule)
throws DecisionMethodException
DecisionMethodExceptionpublic boolean verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result)
throws DecisionMethodException
verifyRules in interface IDecisionMethodDecisionMethodExceptionprotected 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 ruleDecisionMethodExceptionpublic boolean classify(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result)
throws DecisionMethodException
classify in interface IDecisionMethodDecisionMethodExceptionpublic abstract void setParameters(org.openscience.cdk.interfaces.IAtomContainer mol)
setParameters in interface IDecisionMethodmol - public JComponent optionsPanel(org.openscience.cdk.interfaces.IAtomContainer atomContainer)
public int getNumberOfRules()
getNumberOfRules in interface IDecisionMethodpublic IDecisionRule getRule(int id)
getRule in interface IDecisionMethodIDecisionMethod.getRule(int)public IDecisionRule getRule(String name)
getRule in interface IDecisionMethodIDecisionMethod.getRule(java.lang.String)public void printToStream(OutputStream os) throws IOException
os - IOExceptionpublic void printResults(String filename) throws IOException
filename - IOExceptionpublic boolean isFalseIfRuleNotImplemented()
public void setFalseIfRuleNotImplemented(boolean falseIfRuleNotImplemented)
public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in interface IDecisionMethodpublic void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in interface IDecisionMethodpublic IDecisionCategories getCategories()
getCategories in interface IDecisionMethodpublic IDecisionResult createDecisionResult()
createDecisionResult in interface IDecisionMethodpublic int getNumberOfClasses()
getNumberOfClasses in interface IDecisionMethodpublic IDecisionRuleList getRules()
getRules in interface IDecisionMethodpublic String getExplanation()
getExplanation in interface IDecisionMethodpublic void setExplanation(String explanation)
setExplanation in interface IDecisionMethodpublic void update(Observable o, Object arg)
public IDecisionRule getTopRule()
getTopRule in interface IDecisionMethodprotected void setChanged()
setChanged in class Observableprotected void clearChanged()
clearChanged in class Observablepublic boolean isModified()
isModified in interface IDecisionMethodpublic void setModified(boolean value)
setModified in interface IDecisionMethodpublic IDecisionMethodEditor getEditor()
IDecisionMethodIDecisionMethodEditor.
The editor shall provide user interface for visualization and modification of various method settings.getEditor in interface IDecisionMethodIDecisionMethodEditorpublic void fromXML(Element xml) throws XMLDecisionMethodException
fromXML in interface XMLSerializableXMLDecisionMethodExceptionpublic Element toShallowXML(Document document) throws XMLDecisionMethodException
toShallowXML in interface XMLSerializableXMLDecisionMethodExceptionpublic Element toXML(Document document) throws XMLDecisionMethodException
toXML in interface XMLSerializableXMLDecisionMethodExceptionpublic void setRules(IDecisionRuleList rules)
public void setCategories(IDecisionCategories categories)
public int getPriority()
getPriority in interface IDecisionMethodProritypublic void setPriority(int priority)
setPriority in interface IDecisionMethodProritypublic void walkRules(IDecisionRule rule, IProcessRule processor) throws DecisionMethodException
walkRules in interface IDecisionMethodDecisionMethodExceptionprotected void walkRules(IDecisionRule rule, ArrayList<Integer> visited, IProcessRule processor) throws DecisionMethodException
DecisionMethodExceptionpublic BufferedImage getImage(org.openscience.cdk.interfaces.IAtomContainer mol) throws net.idea.modbcum.i.exceptions.AmbitException
getImage in interface ambit2.core.data.IStructureDiagramDepiction<BufferedImage>net.idea.modbcum.i.exceptions.AmbitExceptionpublic BufferedImage getImage(org.openscience.cdk.interfaces.IAtomContainer mol, String ruleID, int width, int height, boolean atomnumbers) throws net.idea.modbcum.i.exceptions.AmbitException
getImage in interface ambit2.core.data.IStructureDiagramDepiction<BufferedImage>net.idea.modbcum.i.exceptions.AmbitExceptionpublic void setWeb(Boolean web)
setWeb in interface IDecisionMethodpublic boolean isWeb()
isWeb in interface IDecisionMethodpublic BufferedImage getLegend(int width, int height) throws net.idea.modbcum.i.exceptions.AmbitException
getLegend in interface ambit2.core.data.IStructureDiagramDepiction<BufferedImage>net.idea.modbcum.i.exceptions.AmbitExceptionCopyright © 2004–2018 Ideaconsult Ltd. All rights reserved.