biz.hammurapi.rules
Class Derivation

java.lang.Object
  extended by biz.hammurapi.rules.Derivation
All Implemented Interfaces:
biz.hammurapi.swing.Visualizable, biz.hammurapi.xml.dom.DomSerializable, java.io.Serializable

public class Derivation
extends java.lang.Object
implements biz.hammurapi.xml.dom.DomSerializable, java.io.Serializable, biz.hammurapi.swing.Visualizable

This class is a tracking element for inference process. It is created by rules during inference process and attached to facts.

Author:
Pavel Vlasov
See Also:
Serialized Form

Constructor Summary
Derivation(java.lang.Object target)
           
 
Method Summary
 void addSourceFact(java.lang.Object fact)
          Adds fact to derivation.
 boolean equals(java.lang.Object obj)
           
 int getDepth()
          Derivation depth is the size of the longest of logical chains which lead to this derivation.
 java.util.Set getFacts()
           
 java.lang.String getRuleFullName()
           
 java.lang.Object getRuleInstance()
           
 java.lang.reflect.Method getRuleMethod()
           
 int hashCode()
           
 boolean isDerivedFrom(java.lang.Object fact)
           
 boolean negatedBy(Negator negator)
          Derivation is negated if any of its constituent facts in negated.
 void toDom(org.w3c.dom.Element holder)
           
 java.lang.String toString()
           
 javax.swing.tree.TreeNode toTreeNode(javax.swing.tree.TreeNode parent, java.lang.String title)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Derivation

public Derivation(java.lang.Object target)
Parameters:
target -
Method Detail

getRuleInstance

public java.lang.Object getRuleInstance()

getRuleMethod

public java.lang.reflect.Method getRuleMethod()

getDepth

public int getDepth()
Derivation depth is the size of the longest of logical chains which lead to this derivation.

Returns:
derivation depth

addSourceFact

public void addSourceFact(java.lang.Object fact)
Adds fact to derivation. If fact is instance of conclusion then its derivation depth becomes Max(ownDepth, conclusionDepth).

Parameters:
fact -

getRuleFullName

public java.lang.String getRuleFullName()
Returns:
Full rule name which includes class and method names and object hash code

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toDom

public void toDom(org.w3c.dom.Element holder)
Specified by:
toDom in interface biz.hammurapi.xml.dom.DomSerializable

negatedBy

public boolean negatedBy(Negator negator)
Derivation is negated if any of its constituent facts in negated.

Parameters:
negator -
Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getFacts

public java.util.Set getFacts()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toTreeNode

public javax.swing.tree.TreeNode toTreeNode(javax.swing.tree.TreeNode parent,
                                            java.lang.String title)
Specified by:
toTreeNode in interface biz.hammurapi.swing.Visualizable

isDerivedFrom

public boolean isDerivedFrom(java.lang.Object fact)


Copyright © 2005 Hammurapi Group. All Rights Reserved.