jess
Class JessEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--jess.JessEvent
All Implemented Interfaces:
java.io.Serializable

public class JessEvent
extends java.util.EventObject

JessEvents are used by JessEvent sources (like the Rete class) to convey information about interesting things that happen to registered event listeners.

(C) 1997 Ernest J. Friedman-Hill and Sandia National Laboratories

Author:
Ernest J Friedman-Hill
See Also:
JessListener, Rete.addJessListener(jess.JessListener), Rete.removeJessListener(jess.JessListener), Serialized Form

Field Summary
static int ACTIVATION
          A defrule has been activated or deactivated
static int CLEAR
          A (clear) has been executed
static int DEFCLASS
          A defclass has been added or removed
static int DEFFACTS
          A deffacts has been added or removqed
static int DEFGLOBAL
          A defglobal has been added or removed
static int DEFINSTANCE
          A definstance has been added or removed
static int DEFRULE
          A defrule has been added or removed
static int DEFRULE_FIRED
          A defrule has been fired
static int DEFTEMPLATE
          A deftemplate has been added or removed
static int FACT
          A fact has been asserted or retracted
static int FOCUS
          The module focus has changed
static int HALT
          A (run) has been executed
static int MODIFIED
          Added to other event-related flags to indicate modified fact
static int REMOVED
          Added to other event-related flags to indicate removal of construct
static int RESET
          A (reset) has been executed
static int RETE_TOKEN
          A Rete node has been reached by a token.
static int RETE_TOKEN_LEFT
          A Rete node has been reached by a token, calltype left
static int RETE_TOKEN_RIGHT
          A Rete node has been reached by a token, calltype right
static int RUN
          A (run) has been executed
static int USERFUNCTION
          A userfunction has been added or removed
static int USERFUNCTION_CALLED
          A userfunction has been called
static int USERPACKAGE
          A userpackage has been added or removed
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
JessEvent(java.lang.Object source, int type, java.lang.Object obj)
          Construct a JessEvent containing the given information.
 
Method Summary
 java.lang.Object getObject()
          Gets any optional data associated with this event.
 int getType()
          Gets the type of this event.
 java.lang.String toString()
          Return a string suitable for debugging.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFRULE

public static final int DEFRULE
A defrule has been added or removed

DEFRULE_FIRED

public static final int DEFRULE_FIRED
A defrule has been fired

ACTIVATION

public static final int ACTIVATION
A defrule has been activated or deactivated

DEFFACTS

public static final int DEFFACTS
A deffacts has been added or removqed

FACT

public static final int FACT
A fact has been asserted or retracted

DEFINSTANCE

public static final int DEFINSTANCE
A definstance has been added or removed

DEFTEMPLATE

public static final int DEFTEMPLATE
A deftemplate has been added or removed

DEFCLASS

public static final int DEFCLASS
A defclass has been added or removed

DEFGLOBAL

public static final int DEFGLOBAL
A defglobal has been added or removed

USERFUNCTION

public static final int USERFUNCTION
A userfunction has been added or removed

USERPACKAGE

public static final int USERPACKAGE
A userpackage has been added or removed

CLEAR

public static final int CLEAR
A (clear) has been executed

RESET

public static final int RESET
A (reset) has been executed

RUN

public static final int RUN
A (run) has been executed

HALT

public static final int HALT
A (run) has been executed

RETE_TOKEN

public static final int RETE_TOKEN
A Rete node has been reached by a token. Deliberately equal to RETE_TOKEN_LEFT

RETE_TOKEN_LEFT

public static final int RETE_TOKEN_LEFT
A Rete node has been reached by a token, calltype left

RETE_TOKEN_RIGHT

public static final int RETE_TOKEN_RIGHT
A Rete node has been reached by a token, calltype right

USERFUNCTION_CALLED

public static final int USERFUNCTION_CALLED
A userfunction has been called

FOCUS

public static final int FOCUS
The module focus has changed

MODIFIED

public static final int MODIFIED
Added to other event-related flags to indicate modified fact

REMOVED

public static final int REMOVED
Added to other event-related flags to indicate removal of construct
Constructor Detail

JessEvent

public JessEvent(java.lang.Object source,
                 int type,
                 java.lang.Object obj)
Construct a JessEvent containing the given information.
Parameters:
source - the object (usually an instance of Rete) generating the event.
type - one of the manifest constants in this class.
obj - data relevant to the specific type of this event.
Method Detail

getType

public int getType()
Gets the type of this event. The type should be one of the manifest constants in this class.
Returns:
the event's type.

getObject

public java.lang.Object getObject()
Gets any optional data associated with this event. The type of this data depends on the type of the event object.
Returns:
the optional data.
See Also:
getType()

toString

public java.lang.String toString()
Return a string suitable for debugging.
Overrides:
toString in class java.util.EventObject
Returns:
Something like [JessEvent: type=37].

© 1997 E.J. Friedman-Hill and Sandia Corporation