Java Doc for FactImpl.java in  » Rule-Engine » Mandarax » org » mandarax » reference » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » Mandarax » org.mandarax.reference 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mandarax.kernel.LObject
      org.mandarax.reference.Complex
         org.mandarax.reference.FactImpl

All known Subclasses:   org.mandarax.reference.PrerequisiteImpl,
FactImpl
public class FactImpl extends Complex implements Fact,Query(Code)
Reference implementation for (simple) facts. In older versions (prior to 1.9) there was no separate Query interface/class - facts were used instead. In order to facilitate maintanance of older applications, this class still implements Query. Some newer features, in particular DerivationEventListeners, are not supported. For queries, QueryImpl should be used instead.
See Also:   QueryImpl
author:
   Jens Dietrich
version:
   3.4 <7 March 05>
since:
   1.1
since:
   Prova re-integration modifications
author:
   Alex Kozlenkov
version:
   3.4 <7 March 05>



Constructor Summary
public  FactImpl()
     Constructor.
 FactImpl(org.mandarax.kernel.Predicate p)
     Constructor.
 FactImpl(org.mandarax.kernel.Predicate p, Term[] t)
     Constructor.

Method Summary
public  voidaddClauseSetChangeListener(ClauseSetChangeListener l)
     Add a clause set listener.
public  Clauseapply(java.util.Collection r)
     Apply a set of replacements to a clause.
public  Clauseapply(Replacement r)
     Apply a single replacement to a fact.
public  FactapplyToFact(java.util.Collection r)
     Apply a set of replacements to a fact.
public  FactapplyToFact(Replacement r)
     Apply a single replacement to a fact.
public  org.mandarax.util.ClauseIteratorclauses()
     Get an iterator for clauses.
public  org.mandarax.util.ClauseIteratorclauses(Clause query, Object additionalParameter)
     Get an iterator for clauses.
protected  voidcopyStructure(FactImpl f)
     Copy the structure, i.e.
public  booleanequals(Object obj)
     Check whether objects are equal.
protected  voidfireClauseSetChangeEvent(ClauseSetChangeEvent e)
    
protected  org.mandarax.kernel.ConstructorgetConstructor()
     Get the object constructing the complex.
public  ClauseSetgetContainer()
     Get the clause set containing the clause.
public  DerivationEventListener[]getDerivationEventListeners()
     Get the registered derivation event listeners.
public  Fact[]getFacts()
     Get the facts.
public  ObjectgetKey()
     Get a key for fast access.
public  StringgetName()
     Get the common name of this query, i.e., something like "Find the oncle of a person".
public  java.util.ListgetNegativeLiterals()
     Get the negative literals.
public  java.util.ListgetPositiveLiterals()
     Get the positive literals.
public  org.mandarax.kernel.PredicategetPredicate()
     Get the predicate.
public  PropertiesgetProperties()
     Get the properties as one "properties" instance.
public  StringgetProperty(String key)
     Get a property.
Parameters:
  key - the property key the respective value.
public  inthashCode()
     Get the hash code of a fact.
public  booleanisAtomic()
     Indicates whether the clause is atomic.
public  booleanisBound()
    
public  booleanisEmpty()
     Indicates whether the clause is the empty clause.
public  booleanisExecutable()
     Indicates whether the object (usually a term or a clause set) can be performed using the java semantics.
public  booleanisGround()
     Indicates whether the clause is ground (= does not have variables).
public  booleanisNegatedAF()
    
public  Iteratorpredicates()
     Get an iterator iterating over the predicates contained in this clause set.
public  EnumerationpropertyNames()
     Returns an enumeration of all the keys in this property list, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list.
public  voidremoveClauseSetChangeListener(ClauseSetChangeListener l)
     Remove a clause set listener.
public  ObjectremoveProperty(String key)
     Remove a property.
public  Objectresolve(Session session)
     Resolve a fact: if supported, the predicate should be performed using its semantic.
public  voidsetContainer(ClauseSet aContainer)
     Set a container.
public  voidsetDerivationEventListeners(DerivationEventListener[] listeners)
     Set the derivation event listeners.
public  voidsetFacts(Fact[] facts)
     Set the facts.
public  voidsetName(String queryName)
     Set the common name of this query.
public  voidsetPredicate(org.mandarax.kernel.Predicate p)
     Set a new predicate.
public  voidsetProperties(Properties properties)
     Set the properties.
public  ObjectsetProperty(String key, String value)
     Set a property.


Constructor Detail
FactImpl
public FactImpl()(Code)
Constructor.



FactImpl
FactImpl(org.mandarax.kernel.Predicate p)(Code)
Constructor.
Parameters:
  p - the predicate



FactImpl
FactImpl(org.mandarax.kernel.Predicate p, Term[] t)(Code)
Constructor.
Parameters:
  p - the predicate
Parameters:
  t - the terms




Method Detail
addClauseSetChangeListener
public void addClauseSetChangeListener(ClauseSetChangeListener l)(Code)
Add a clause set listener.
Parameters:
  l - a listener



apply
public Clause apply(java.util.Collection r)(Code)
Apply a set of replacements to a clause. Returns a new clause! the fact (clause) resulting from the application of the replacements
Parameters:
  r - a collection of replacements



apply
public Clause apply(Replacement r)(Code)
Apply a single replacement to a fact. Returns a new clause! the fact (clause) resulting from the application of the replacemen
Parameters:
  r - the replacement



applyToFact
public Fact applyToFact(java.util.Collection r)(Code)
Apply a set of replacements to a fact. Returns a new fact! the fact resulting from the application of the replacement
Parameters:
  r - a collection of replacement



applyToFact
public Fact applyToFact(Replacement r)(Code)
Apply a single replacement to a fact. Returns a new fact! the fact (clause) resulting from the application of the replacement
Parameters:
  r - a replacement



clauses
public org.mandarax.util.ClauseIterator clauses()(Code)
Get an iterator for clauses. a clause iterator



clauses
public org.mandarax.util.ClauseIterator clauses(Clause query, Object additionalParameter)(Code)
Get an iterator for clauses. The parameters are ignored and clauses() is called! a clause iterator
Parameters:
  query - a query
Parameters:
  additionalParameter - an additional parameter



copyStructure
protected void copyStructure(FactImpl f)(Code)
Copy the structure, i.e. length of the terms, types of the terms and methods,
Parameters:
  f - the fact that takes the structure from this object



equals
public boolean equals(Object obj)(Code)
Check whether objects are equal.
Parameters:
  obj - the object to compare this object with true if the objects are equal, false otherwise



fireClauseSetChangeEvent
protected void fireClauseSetChangeEvent(ClauseSetChangeEvent e)(Code)
Fire a clause set change event
Parameters:
  e - the event



getConstructor
protected org.mandarax.kernel.Constructor getConstructor()(Code)
Get the object constructing the complex. the predicate of this fact



getContainer
public ClauseSet getContainer()(Code)
Get the clause set containing the clause. This method is in particular useful for analyzing derivations, since derivations show only the clauses used, not the clause set generating this clauses (e.g., AutoFacts). On the other hand, knowledge bases contain often clause sets. So it could be hard to find the clause sets in the knowledge base that caused a certain result. For some clauses such as facts, the container is just the fact itself. a clause set



getDerivationEventListeners
public DerivationEventListener[] getDerivationEventListeners()(Code)
Get the registered derivation event listeners. an array of listeners



getFacts
public Fact[] getFacts()(Code)
Get the facts.
See Also:   org.mandarax.kernel.Query an array of facts



getKey
public Object getKey()(Code)
Get a key for fast access. The key is usually the predicate, but subclasses might want to use different keys. Note that keys are mainly used by inference engines and knowledge bases to improve performance and inference engine and knowledge bases must know about the semantics of keys to use them correctly! the key object



getName
public String getName()(Code)
Get the common name of this query, i.e., something like "Find the oncle of a person". a string



getNegativeLiterals
public java.util.List getNegativeLiterals()(Code)
Get the negative literals. the collection of negative literals, this is an empty collection!



getPositiveLiterals
public java.util.List getPositiveLiterals()(Code)
Get the positive literals. the collection of positive literals, this is a singleton containing only this object



getPredicate
public org.mandarax.kernel.Predicate getPredicate()(Code)
Get the predicate. the predicate



getProperties
public Properties getProperties()(Code)
Get the properties as one "properties" instance. a properties instance



getProperty
public String getProperty(String key)(Code)
Get a property.
Parameters:
  key - the property key the respective value. The method returns null if the property is not found.



hashCode
public int hashCode()(Code)
Get the hash code of a fact. the hash value



isAtomic
public boolean isAtomic()(Code)
Indicates whether the clause is atomic. a boolean



isBound
public boolean isBound()(Code)
Whether the fact contains variables boolean



isEmpty
public boolean isEmpty()(Code)
Indicates whether the clause is the empty clause. false



isExecutable
public boolean isExecutable()(Code)
Indicates whether the object (usually a term or a clause set) can be performed using the java semantics. a boolean



isGround
public boolean isGround()(Code)
Indicates whether the clause is ground (= does not have variables). a boolean



isNegatedAF
public boolean isNegatedAF()(Code)
Indicates whether the fact is negated (negation as failure) always false
See Also:   PrerequisiteImpl



predicates
public Iterator predicates()(Code)
Get an iterator iterating over the predicates contained in this clause set. an iterator



propertyNames
public Enumeration propertyNames()(Code)
Returns an enumeration of all the keys in this property list, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list. an enumeration of all the keys in this property list, including the keys inthe default property list



removeClauseSetChangeListener
public void removeClauseSetChangeListener(ClauseSetChangeListener l)(Code)
Remove a clause set listener.
Parameters:
  l - a listener



removeProperty
public Object removeProperty(String key)(Code)
Remove a property.
Parameters:
  key - the property key the value to which the key had been mapped, or null if the key did not have a mapping.



resolve
public Object resolve(Session session) throws UnsupportedOperationException, IllegalArgumentException(Code)
Resolve a fact: if supported, the predicate should be performed using its semantic. E.g., for a fact like isFather(Max,Jens) the function isFather is performed for the objects (constant terms) Max and Jens and the result (e.g., true) is returned. Note that not all predicates support this (since not all predicates have a semantic), and the operation can also fail in case one term is variable. In these cases we throw appropriate exceptions.
Parameters:
  session - a session object the result of resolving the term
throws:
  java.lang.UnsupportedOperationException -
throws:
  java.lang.IllegalArgumentException -



setContainer
public void setContainer(ClauseSet aContainer)(Code)
Set a container.
Parameters:
  aContainerthe - new container



setDerivationEventListeners
public void setDerivationEventListeners(DerivationEventListener[] listeners)(Code)
Set the derivation event listeners.
Parameters:
  listeners - listeners



setFacts
public void setFacts(Fact[] facts)(Code)
Set the facts. Not supported by facts, throws an exception! Please use QueryImpl for queries!
See Also:   org.mandarax.kernel.Query
Parameters:
  facts - an array of facts



setName
public void setName(String queryName)(Code)
Set the common name of this query.
Parameters:
  a - name



setPredicate
public void setPredicate(org.mandarax.kernel.Predicate p)(Code)
Set a new predicate.
Parameters:
  p - the predicate



setProperties
public void setProperties(Properties properties)(Code)
Set the properties. Not required by the interface, but useful for bean (introspection-) based tools.
Parameters:
  properties - the properties



setProperty
public Object setProperty(String key, String value)(Code)
Set a property.
Parameters:
  key - the key
Parameters:
  value - the value the previous value of the specified key in this property list, or null if it did not have one.



Fields inherited from org.mandarax.reference.Complex
protected Term[] terms(Code)(Java Doc)
protected Class[] types(Code)(Java Doc)

Methods inherited from org.mandarax.reference.Complex
abstract protected Constructor getConstructor()(Code)(Java Doc)
public Term[] getTerms()(Code)(Java Doc)
public void setTerm(Term t, int i)(Code)(Java Doc)
public void setTerms(Term[] t)(Code)(Java Doc)
public TermIterator terms()(Code)(Java Doc)
public String toString()(Code)(Java Doc)


Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.