jess
Class Defglobal
java.lang.Object
|
+--jess.Defglobal
- public class Defglobal
- extends java.lang.Object
- implements JessListener, java.io.Serializable
Class used to represent Defglobals. You can create Defglobals and add them to a
Rete engine using Rete.addDefglobal.
(C) 1997 Ernest J. Friedman-Hill and Sandia National Laboratories
- Author:
- Ernest J. Friedman-Hill
- See Also:
- Serialized Form
|
Constructor Summary |
Defglobal(java.lang.String name,
Value val)
Create a defglobal. |
|
Method Summary |
void |
eventHappened(JessEvent je)
On a RESET event, reenter myself into engine, but only if the engine thinks it's
appropriate (i,e., depending on the current set-reset-globals setting.) On a CLEAR
event, unlink myself from the engine. |
java.lang.String |
getName()
Get this defglobal's variable name |
java.lang.String |
toString()
Describe myself |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Defglobal
public Defglobal(java.lang.String name,
Value val)
throws JessException
- Create a defglobal. Should be added to a Rete object with
Rete.addDefglobal. Note that a separate Defglobal object must be created
for each global variable, even though one (defglobal) construct may represent
more than one such variable.
- Parameters:
name - The defglobal's variable name. Note that the name must begin and
end with an asterisk.val - The initial value for the defglobal; can be an RU.FUNCALL value.- Throws:
- JessException - If anything goes wrong.
eventHappened
public void eventHappened(JessEvent je)
throws JessException
- On a RESET event, reenter myself into engine, but only if the engine thinks it's
appropriate (i,e., depending on the current set-reset-globals setting.) On a CLEAR
event, unlink myself from the engine.
- Specified by:
- eventHappened in interface JessListener
- Parameters:
je - The event- Throws:
- JessException - If anything goes wrong.
getName
public java.lang.String getName()
- Get this defglobal's variable name
- Returns:
- The variable name
toString
public java.lang.String toString()
- Describe myself
- Returns:
- A pretty-printed version of the defglobal, suitable for parsing
- Overrides:
- toString in class java.lang.Object