public class DecisionNode extends Observable implements IDecisionRule, IDecisionTransition, Observer
UserDefinedTree. Implements IDecisionRule
and IDecisionTransition.
A decision node consists of a rule IDecisionRule and decision nodes DecisionNode
to be followed, or categories IDecisionCategory to be assigned if the rule provides YES or NO answer.
| Modifier and Type | Field and Description |
|---|---|
protected IDecisionCategory[] |
categories |
protected DecisionNode[] |
nodes |
protected IDecisionRule |
rule |
protected boolean |
visited |
| Constructor and Description |
|---|
DecisionNode()
Constructor
|
DecisionNode(IDecisionRule rule)
Constructs a decision node with rule, null next nodes.
|
DecisionNode(IDecisionRule rule,
DecisionNode nodeNo,
DecisionNode nodeYes)
Constructs a decision node with rule, nodeNo at branch NO and nodeYes at branch YES.
|
DecisionNode(IDecisionRule rule,
DecisionNode nodeNo,
DecisionNode nodeYes,
IDecisionCategory categoryNo,
IDecisionCategory categoryYes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l) |
void |
clearFlags(org.openscience.cdk.interfaces.IAtomContainer mol)
When rules analyze a molecule, a set of properties are set.
|
Object |
clone() |
boolean |
equals(Object obj) |
IDecisionRule |
getBranch(boolean answer)
returns the decision rule at the branch No if answer==false or
the decision rule at the branch Yes if answer =true
|
IDecisionCategory[] |
getCategories() |
IDecisionCategory |
getCategory(boolean answer)
returns the decision category at the branch No if answer==false or
the category at the branch Yes if answer =true
|
IDecisionRuleEditor |
getEditor()
Each rule provides an editor, which is a class implementing
IDecisionRuleEditor. |
org.openscience.cdk.interfaces.IAtomContainer |
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
|
String |
getExplanation()
Rule explanation is an arbitrary text, could be multiline and may contain
html tags.
|
String |
getID()
Rule identifier is an arbitrary string, preferably short one
|
DecisionNode[] |
getNodes() |
int |
getNum() |
IDecisionRule |
getRule() |
ambit2.rendering.IAtomContainerHighlights |
getSelector() |
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() |
boolean |
isVisited() |
void |
removePropertyChangeListener(PropertyChangeListener l) |
void |
setBranch(boolean answer,
IDecisionRule node)
Sets the decision rule at the branch No if answer==false or
the decision rule at the branch Yes if answer =true
|
void |
setCategories(IDecisionCategory[] categories) |
void |
setCategory(boolean answer,
IDecisionCategory category)
/**
Sets the category at the branch No if answer==false or
the category at the branch Yes if answer =true
|
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 |
setExplanation(String message)
Sets rule explanation
|
void |
setID(String id)
Sets rule identifier
|
void |
setNodes(DecisionNode[] nodes) |
void |
setNum(int no) |
void |
setRule(IDecisionRule rule)
Sets rule
|
void |
setTitle(String name)
Sets rule name
|
void |
setVisited(boolean visited) |
String |
toString() |
String |
toString(boolean verbose)
Returns string representation of the decision node
if (verbose) returns getId() + "." + getName()
else returns "Q"+getId();
|
void |
update(Observable arg0,
Object arg1) |
boolean |
verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol)
This is the core of a
IDecisionRule behaviour. |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedprotected IDecisionRule rule
protected DecisionNode[] nodes
protected IDecisionCategory[] categories
protected transient boolean visited
public DecisionNode()
public DecisionNode(IDecisionRule rule)
rule - public DecisionNode(IDecisionRule rule, DecisionNode nodeNo, DecisionNode nodeYes)
rule - nodeNo - nodeYes - public DecisionNode(IDecisionRule rule, DecisionNode nodeNo, DecisionNode nodeYes, IDecisionCategory categoryNo, IDecisionCategory categoryYes)
rule - - the rulenodeNo - - the node at branch "No"nodeYes - - the node at branch "Yes"categoryNo - - the Category at branch "No"categoryYes - - the Category at branch "Yes"public boolean isEditable()
isEditable in interface IDecisionRulepublic void setEditable(boolean value)
setEditable in interface IDecisionRulepublic IDecisionRule getRule()
public void setRule(IDecisionRule rule)
rule - public IDecisionRule getBranch(boolean answer)
getBranch in interface IDecisionTransitionpublic void setBranch(boolean answer,
IDecisionRule node)
answer - - selects which branch to be setnode - - the next node to setpublic IDecisionCategory getCategory(boolean answer)
getCategory in interface IDecisionTransitionpublic void setCategory(boolean answer,
IDecisionCategory category)
answer - category - public String toString(boolean verbose)
verbose - public String toString()
toString in interface IDecisionRuletoString in class Objectpublic org.openscience.cdk.interfaces.IAtomContainer getExampleMolecule(boolean ruleResult)
throws DecisionMethodException
IDecisionRulegetExampleMolecule in interface IDecisionRuleorg.openscience.cdk.interfaces.MoleculeDecisionMethodExceptionpublic String getExplanation()
IDecisionRulegetExplanation in interface IDecisionRulepublic String getID()
IDecisionRulegetID in interface IDecisionRulepublic String getTitle()
IDecisionRulegetTitle in interface IDecisionRulepublic int getNum()
getNum in interface IDecisionRulepublic boolean isImplemented()
isImplemented in interface IDecisionRulepublic void setExampleMolecule(org.openscience.cdk.interfaces.IAtomContainer mol,
boolean ruleResult)
IDecisionRulesetExampleMolecule in interface IDecisionRulemol - org.openscience.cdk.interfaces.Moleculepublic void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in interface IDecisionRulepublic void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in interface IDecisionRulepublic void setExplanation(String message)
IDecisionRulesetExplanation in interface IDecisionRulepublic void setID(String id)
IDecisionRulesetID in interface IDecisionRulepublic void setTitle(String name)
IDecisionRulesetTitle in interface IDecisionRulepublic void setNum(int no)
setNum in interface IDecisionRulepublic boolean verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol)
throws DecisionMethodException
IDecisionRuleIDecisionRule 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??verifyRule in interface IDecisionRulemol - org.openscience.cdk.interfaces.AtomContainerDecisionMethodExceptionpublic boolean isVisited()
public void setVisited(boolean visited)
visited - The visited to set.public void clearFlags(org.openscience.cdk.interfaces.IAtomContainer mol)
IDecisionRuleclearFlags in interface IDecisionRulemol - org.openscience.cdk.interfaces.Moleculepublic void hideResiduesID(boolean hide)
hideResiduesID in interface IDecisionRulepublic boolean isResidueIDHidden()
isResidueIDHidden in interface IDecisionRulepublic IDecisionRuleEditor getEditor()
IDecisionRuleIDecisionRuleEditor.
The editor shall provide user interface for visualization and modification of various rule settings.getEditor in interface IDecisionRuleIDecisionRuleEditorpublic Object clone() throws CloneNotSupportedException
clone in interface IDecisionRuleclone in class ObjectCloneNotSupportedExceptionpublic void update(Observable arg0, Object arg1)
public IDecisionCategory[] getCategories()
public void setCategories(IDecisionCategory[] categories)
public DecisionNode[] getNodes()
public void setNodes(DecisionNode[] nodes)
public ambit2.rendering.IAtomContainerHighlights getSelector()
getSelector in interface IDecisionRuleCopyright © 2004–2018 Ideaconsult Ltd. All rights reserved.