public class RuleVerifyProperty extends AbstractRule implements IDecisionInteractive, IImplementationDetails
getProperty() value. Property
to be read as IAtomContainer.getProperty(getPropertyName()).
If there exist no such property of the molecule, a
inputProperty(IAtomContainer) method is invoked, which typically
waits for user input of the property value. If the property is not assigned
after inputProperty(IAtomContainer) call, then
DRuleNotImplemented is fired.IDecisionInteractive.UserOptions| Modifier and Type | Field and Description |
|---|---|
protected String |
condition |
static String |
condition_equals |
static String |
condition_higher |
static String |
condition_lower |
protected PropertyChangeListener |
listener |
protected static NumberFormat |
nf |
protected IDecisionInteractive.UserOptions |
options |
protected double[] |
propertyExamples |
protected String |
propertyName |
protected Double |
propertyStaticValue |
protected String |
propertyUnits |
changes, editable, ERR_STRUCTURENOTPREPROCESSED, examples, explanation, id, logger, MSG_NO, MSG_YES, no, residueIDHidden, titlexmltag_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 |
|---|
RuleVerifyProperty() |
RuleVerifyProperty(String propertyName,
String units,
String condition,
double value) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
compare(double Param1,
double Param2) |
String |
getCaption() |
String |
getCondition() |
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 |
getImplementationDetails() |
boolean |
getInteractive() |
PropertyChangeListener |
getListener() |
IDecisionInteractive.UserOptions |
getOptions() |
double |
getProperty() |
String |
getPropertyName() |
String |
getPropertyUnits()
public String inputProperty(IAtomContainer mol) {
PropertyEditor p = new PropertyEditor(mol,new
OptionsPanel(toString(),mol, this)); if
(JOptionPane.showConfirmDialog(null,p,"Rule " + getID() + "." +
getCaption(), JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE) ==
JOptionPane.OK_OPTION) { setInteractive(!p.isSilent()); return
p.getPropertyValue(); } else return null; //return
JOptionPane.showInputDialog("Enter " + propertyName + "," +
propertyUnits); }
|
ambit2.rendering.IAtomContainerHighlights |
getSelector() |
String |
inputProperty(org.openscience.cdk.interfaces.IAtomContainer mol) |
boolean |
isImplemented() |
void |
removeListener() |
void |
setCondition(String condition) |
void |
setInteractive(boolean value) |
void |
setListener(PropertyChangeListener listener) |
void |
setOptions(IDecisionInteractive.UserOptions options) |
void |
setProperty(double propertyStaticValue) |
void |
setPropertyName(String propertyName) |
void |
setPropertyUnits(String propertyUnits) |
boolean |
verifyRule(org.openscience.cdk.interfaces.IAtomContainer mol)
This is the core of a
IDecisionRule behaviour. |
addPropertyChangeListener, clearFlags, clone, createRule, equals, fromXML, getEditor, getExamples, getID, getNum, getTitle, hideResiduesID, isEditable, isResidueIDHidden, log, log, log, makeMolecule, removePropertyChangeListener, setEditable, setExampleMolecule, setExamples, setExplanation, setID, setNum, setTitle, toShallowXML, toString, toXMLaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedprotected Double propertyStaticValue
protected String propertyName
protected String propertyUnits
protected IDecisionInteractive.UserOptions options
public static String condition_higher
public static String condition_lower
public static String condition_equals
protected String condition
protected static NumberFormat nf
protected double[] propertyExamples
protected PropertyChangeListener listener
public IDecisionInteractive.UserOptions getOptions()
getOptions in interface IDecisionInteractivepublic void setOptions(IDecisionInteractive.UserOptions options)
setOptions in interface IDecisionInteractivepublic PropertyChangeListener getListener()
getListener in interface IDecisionInteractivepublic void setListener(PropertyChangeListener listener)
setListener in interface IDecisionInteractivepublic String getCaption()
public 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 String inputProperty(org.openscience.cdk.interfaces.IAtomContainer mol) throws DecisionMethodException
DecisionMethodExceptionpublic void setProperty(double propertyStaticValue)
public double getProperty()
public void setCondition(String condition)
public String getCondition()
public boolean compare(double Param1,
double Param2)
public boolean isImplemented()
isImplemented in interface IDecisionRuleisImplemented in class AbstractRulepublic String getExplanation()
IDecisionRulegetExplanation in interface IDecisionRulegetExplanation in class AbstractRuleIDecisionRule.getExplanation()public String getPropertyName()
public void setPropertyName(String propertyName)
public org.openscience.cdk.interfaces.IAtomContainer getExampleMolecule(boolean ruleResult)
throws DecisionMethodException
IDecisionRulegetExampleMolecule in interface IDecisionRulegetExampleMolecule in class AbstractRuleorg.openscience.cdk.interfaces.MoleculeDecisionMethodExceptionpublic String getPropertyUnits()
public void setPropertyUnits(String propertyUnits)
public boolean getInteractive()
getInteractive in interface IDecisionInteractivepublic void setInteractive(boolean value)
setInteractive in interface IDecisionInteractivepublic String getImplementationDetails()
getImplementationDetails in interface IImplementationDetailspublic void removeListener()
removeListener in interface IDecisionInteractivepublic ambit2.rendering.IAtomContainerHighlights getSelector()
getSelector in interface IDecisionRulegetSelector in class AbstractRuleCopyright © 2004–2018 Ideaconsult Ltd. All rights reserved.