|
||||||||||
| PREV CLASS NEXT CLASS | NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The WorkingMemory interface represents an Eclipse Working Memory. A WorkingMemory should only be accessed by a single Java thread at a time.
| Method Summary | |
void |
assertOrUpdate(java.lang.Object object)
Assert or update an Object into this WorkingMemory. |
Stream |
findStream(java.lang.String logicalName)
Returns the logical stream if it exists otherwise null |
ObjectIterator |
getAssertedObjects()
Returns an iterator for the asserted objects in this working memory. |
KnowledgeBase |
getKnowledgeBase()
Returns the knowledge base for this working memory. |
java.lang.Object |
getObject()
Returns the object that was associated with the working memory, which may be null |
java.util.Date |
getWorkingMemoryTime()
Returns the time that a working memory uses to determine whether or not a rule is effective or has expired. |
boolean |
isAsserted(java.lang.Object object)
Determines if the given object is currently asserted in the working memory. |
boolean |
isHalted()
Returns true iff the inference engine was explicitly halted. |
boolean |
isRunning()
Indicates whether a call to run() is still executing for a working memory. |
void |
loadFactFile(java.lang.String filename)
This function loads a file containing facts. |
void |
loadXMLfromFile(java.lang.String filename)
This function loads XML from a file |
void |
loadXMLfromReader(java.lang.String systemId,
java.io.Reader reader)
This function loads XML from a reader |
void |
loadXMLfromString(java.lang.String systemId,
java.lang.String xmlData)
This function loads XML from a string |
void |
loadXMLfromURL(java.net.URL url)
This function loads XML from an URL |
StringOutputStream |
newOutputStream(java.lang.String logicalName,
int initialCapacity)
Creates a new logical in-memory output stream for this working memory. |
OutputStream |
newOutputStream(java.lang.String logicalName,
java.lang.String filename,
boolean append)
Creates a new logical file-based output stream for this working memory. |
void |
reset()
Retracts all facts from the WorkingMemory and asserts the initial-fact as well as all facts found within deffacts constructs |
void |
retract(java.lang.Object object)
Retract an object from the WorkingMemory. |
long |
run()
Execute an arbitrary number of activations on this WorkingMemory, using all Rulesets and Agendas. |
long |
run(long limit)
Execute activations on this WorkingMemory up to a given limit, using all Rulesets and Agendas. |
void |
setObject(java.lang.Object object)
Sets the object that was associated with the working memory |
void |
setWorkingMemoryTime(java.util.Date date)
Sets the time that a working memory uses to determine whether or not a rule is effective or has expired. |
| Method Detail |
public java.lang.Object getObject()
throws EclipseException
EclipseException - if the working memory has been deleted
public void setObject(java.lang.Object object)
throws EclipseException
object - the object to be associated with the working memory
EclipseException
public KnowledgeBase getKnowledgeBase()
throws EclipseException
EclipseException - if the working memory has been deleted
public void reset()
throws EclipseException
EclipseException - if the working memory has been deleted
EclipseException - if an error occurred
public long run(long limit)
throws EclipseException
limit - the maximum number of activations to execute, where a negative number for no limit.
EclipseException - if the working memory has been deleted
EclipseException - if Java code (invoked via JNI native code) throws an exception or the run failed
EclipseException - if an error occurredrun(),
Ruleset.run(WorkingMemory),
Ruleset.run(WorkingMemory,long),
Agenda.run(WorkingMemory),
Agenda.run(WorkingMemory,long)
public long run()
throws EclipseException
EclipseException - if the working memory has been deleted
EclipseException - if Java code (invoked via JNI native code) throws an exception
EclipseException - if an error occurredrun(long),
Ruleset.run(WorkingMemory),
Ruleset.run(WorkingMemory,long),
Agenda.run(WorkingMemory),
Agenda.run(WorkingMemory,long)
public boolean isHalted()
throws EclipseException
EclipseException - if the working memory has been deleted
EclipseException - if Java code (invoked via JNI native code) throws an exception
EclipseException - if an error occurredrun(),
run(long),
Ruleset.run(WorkingMemory),
Ruleset.run(WorkingMemory,long),
Agenda.run(WorkingMemory),
Agenda.run(WorkingMemory,long)
public boolean isRunning()
throws EclipseException
EclipseException - if the working memory has been deleted
EclipseException - if an error occurredrun(),
run(long),
Ruleset.run(WorkingMemory),
Ruleset.run(WorkingMemory,long),
Agenda.run(WorkingMemory),
Agenda.run(WorkingMemory,long)
public java.util.Date getWorkingMemoryTime()
throws EclipseException
EclipseException - if the working memory has been deleted
EclipseException - if an error occurredsetWorkingMemoryTime(Date),
Rule.getEffectiveDate(),
Rule.getExpirationDate()
public void setWorkingMemoryTime(java.util.Date date)
throws EclipseException
date - the time that a working memory uses to determine whether or not a rule is effective or has expired
EclipseException - if the working memory has been deleted
EclipseException - if an error occurredgetWorkingMemoryTime(),
Rule.getEffectiveDate(),
Rule.getExpirationDate()
public void loadFactFile(java.lang.String filename)
throws EclipseException
filename - the filename to load
EclipseException - if this method is not supported
EclipseException - if unable to open the file
public void assertOrUpdate(java.lang.Object object)
throws EclipseException
object - an Object
EclipseException - if the working memory has been deleted
EclipseException - if an error occurred
public void retract(java.lang.Object object)
throws EclipseException
object - an Object
EclipseException
public boolean isAsserted(java.lang.Object object)
throws EclipseException
object - an Object
assertOrUpdate(Object)
and not subsequently retracted via retract(Object)
EclipseException
public void loadXMLfromReader(java.lang.String systemId,
java.io.Reader reader)
throws EclipseException
systemId - the identifier for the XMLreader - the source for the XML
EclipseException - if the working memory has been deleted
EclipseException - if an error occurred
public void loadXMLfromString(java.lang.String systemId,
java.lang.String xmlData)
throws EclipseException
systemId - the identifier for the XMLxmlData - the source for the XML
EclipseException - if the working memory has been deleted
EclipseException - if an error occurred
public void loadXMLfromFile(java.lang.String filename)
throws EclipseException
filename - the filename containing the XML
EclipseException - if the working memory has been deleted
EclipseException - if an error occurred
public void loadXMLfromURL(java.net.URL url)
throws EclipseException
url - the URL containing the XML
EclipseException - if the working memory has been deleted
EclipseException - if an error occurred
public ObjectIterator getAssertedObjects()
throws EclipseException
ObjectIterator that iterates over all objects placeed into this working memory by assertOrUpdate(Object).
EclipseException - if an error occurred
public StringOutputStream newOutputStream(java.lang.String logicalName,
int initialCapacity)
throws EclipseException
StringOutputStream.reset() when the
working memory is reset and Stream.close() is called when the working memory is deleted
logicalName - the logical name for the stream that may be used in stream functions accessible to rulesinitialCapacity - the initial capacity of the stream
EclipseException - if a logical stream with the given name already exists
public OutputStream newOutputStream(java.lang.String logicalName,
java.lang.String filename,
boolean append)
throws EclipseException,
java.io.FileNotFoundException
Stream.close() is called for the stream.
logicalName - the logical name for the stream that may be used in stream functions accessible to rulesfilename - the filename for the output streamappend - if true, then bytes will be written to the end of the file rather than the beginning
EclipseException - if a logical stream with the given name already exists
java.io.FileNotFoundException
public Stream findStream(java.lang.String logicalName)
throws EclipseException
logicalName - the logical name for the stream that may be used in stream functions accessible to rules
EclipseException - if an error occurred
|
||||||||||
| PREV CLASS NEXT CLASS | NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||