|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
toxTree.tree.DecisionNode
public class DecisionNode
A decision node to be used in 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.
Field Summary | |
---|---|
protected IDecisionCategory[] |
categories
|
protected DecisionNode[] |
nodes
|
protected IDecisionRule |
rule
|
protected boolean |
visited
|
Constructor Summary | |
---|---|
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)
|
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()
|
boolean |
equals(java.lang.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.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 |
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 |
DecisionNode[] |
getNodes()
|
int |
getNum()
|
IDecisionRule |
getRule()
|
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()
|
boolean |
isVisited()
|
void |
removePropertyChangeListener(java.beans.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(java.lang.String message)
Sets rule explanation |
void |
setID(java.lang.String id)
Sets rule identifier |
void |
setNodes(DecisionNode[] nodes)
|
void |
setNum(int no)
|
void |
setRule(IDecisionRule rule)
Sets rule |
void |
setTitle(java.lang.String name)
Sets rule name |
void |
setVisited(boolean visited)
|
java.lang.String |
toString()
|
java.lang.String |
toString(boolean verbose)
Returns string representation of the decision node if (verbose) returns getId() + "." + getName() else returns "Q"+getId(); |
void |
update(java.util.Observable arg0,
java.lang.Object arg1)
|
boolean |
verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol)
This is the core of a IDecisionRule behaviour. |
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 |
---|
protected IDecisionRule rule
protected DecisionNode[] nodes
protected IDecisionCategory[] categories
protected transient boolean visited
Constructor Detail |
---|
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"Method Detail |
---|
public boolean isEditable()
isEditable
in interface IDecisionRule
public void setEditable(boolean value)
setEditable
in interface IDecisionRule
public IDecisionRule getRule()
public void setRule(IDecisionRule rule)
rule
- public IDecisionRule getBranch(boolean answer)
getBranch
in interface IDecisionTransition
public 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 IDecisionTransition
public void setCategory(boolean answer, IDecisionCategory category)
answer
- category
- public java.lang.String toString(boolean verbose)
verbose
-
public java.lang.String toString()
toString
in interface IDecisionRule
toString
in class java.lang.Object
public org.openscience.cdk.interfaces.IMolecule getExampleMolecule(boolean ruleResult) throws DecisionMethodException
IDecisionRule
getExampleMolecule
in interface IDecisionRule
org.openscience.cdk.interfaces.Molecule
DecisionMethodException
public java.lang.String getExplanation()
IDecisionRule
getExplanation
in interface IDecisionRule
public java.lang.String getID()
IDecisionRule
getID
in interface IDecisionRule
public java.lang.String getTitle()
IDecisionRule
getTitle
in interface IDecisionRule
public int getNum()
getNum
in interface IDecisionRule
public boolean isImplemented()
isImplemented
in interface IDecisionRule
public void setExampleMolecule(org.openscience.cdk.interfaces.IAtomContainer mol, boolean ruleResult)
IDecisionRule
setExampleMolecule
in interface IDecisionRule
mol
- org.openscience.cdk.interfaces.Molecule
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener
in interface IDecisionRule
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener
in interface IDecisionRule
public void setExplanation(java.lang.String message)
IDecisionRule
setExplanation
in interface IDecisionRule
public void setID(java.lang.String id)
IDecisionRule
setID
in interface IDecisionRule
public void setTitle(java.lang.String name)
IDecisionRule
setTitle
in interface IDecisionRule
public void setNum(int no)
setNum
in interface IDecisionRule
public boolean verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol) throws DecisionMethodException
IDecisionRule
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
??
verifyRule
in interface IDecisionRule
mol
- org.openscience.cdk.interfaces.AtomContainer
DecisionMethodException
public boolean isVisited()
public void setVisited(boolean visited)
visited
- The visited to set.public void clearFlags(org.openscience.cdk.interfaces.IAtomContainer mol)
IDecisionRule
clearFlags
in interface IDecisionRule
mol
- org.openscience.cdk.interfaces.Molecule
public void hideResiduesID(boolean hide)
hideResiduesID
in interface IDecisionRule
public boolean isResidueIDHidden()
isResidueIDHidden
in interface IDecisionRule
public IDecisionRuleEditor getEditor()
IDecisionRule
IDecisionRuleEditor
.
The editor shall provide user interface for visualization and modification of various rule settings.
getEditor
in interface IDecisionRule
IDecisionRuleEditor
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface IDecisionRule
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void update(java.util.Observable arg0, java.lang.Object arg1)
update
in interface java.util.Observer
public IDecisionCategory[] getCategories()
public void setCategories(IDecisionCategory[] categories)
public DecisionNode[] getNodes()
public void setNodes(DecisionNode[] nodes)
public ambit2.base.interfaces.IProcessor<org.openscience.cdk.interfaces.IAtomContainer,org.openscience.cdk.renderer.selection.IChemObjectSelection> getSelector()
getSelector
in interface IDecisionRule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |