Enum Class IWatcher.EventType

java.lang.Object
java.lang.Enum<IWatcher.EventType>
laas.openrobots.ontology.modules.events.IWatcher.EventType
All Implemented Interfaces:
Serializable, Comparable<IWatcher.EventType>, Constable
Enclosing interface:
IWatcher

public static enum IWatcher.EventType extends Enum<IWatcher.EventType>
Constants that defines the type of event the event module can handle.

When a watcher is registered into an event source, the source can check what kind of event are expected by calling the IWatcher.getPatternType() method. The interpretation of the watch pattern (returned by IWatcher.getWatchPattern()) depends of the type of event, as follow:

FACT_CHECKING

The watch pattern must be a partial statement. If, when evaluated, it returns true (ie, at least one asserted or inferred statement match the pattern), the event is fired.

NEW_INSTANCE

The event pattern for this type of event is first a variable and then a set of partial statement. The event is triggered when a new statement matches this set. The server return the list of instances bound to the variable.

Example

Registration:
 > registerEvent
 > NEW_INSTANCE
 > ON_TRUE
 > b
 > [?a desires ?b, ?a rdf:type Human]
 
Add some facts:
 > add
 > [ramses rdf:type Human, pyramidInauguration rdf:type StaticSituation, ramses desires pyramidInauguration]
 
This would fire the event and return:
 > event
 > [pyramidInauguration]
 

NEW_CLASS_INSTANCE

The event is triggered when a new instance of the class returned by the watch pattern is added. When the event is fired, the server send to the client the list of the new instances. This kind of event is a special, optimized version of NEW_INSTANCE for class instances.
See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static IWatcher.EventType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static IWatcher.EventType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null