Enum IWatcher.EventType
- java.lang.Object
-
- java.lang.Enum<IWatcher.EventType>
-
- laas.openrobots.ontology.modules.events.IWatcher.EventType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IWatcher.EventType>
- Enclosing interface:
- IWatcher
public static enum IWatcher.EventType extends java.lang.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 byIWatcher.getWatchPattern()
) depends of the type of event, as follow:
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.FACT_CHECKING
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.NEW_INSTANCE
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]
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 ofNEW_CLASS_INSTANCE
NEW_INSTANCE
for class instances.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FACT_CHECKING
NEW_CLASS_INSTANCE
NEW_INSTANCE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IWatcher.EventType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static IWatcher.EventType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FACT_CHECKING
public static final IWatcher.EventType FACT_CHECKING
-
NEW_CLASS_INSTANCE
public static final IWatcher.EventType NEW_CLASS_INSTANCE
-
NEW_INSTANCE
public static final IWatcher.EventType NEW_INSTANCE
-
-
Method Detail
-
values
public static IWatcher.EventType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (IWatcher.EventType c : IWatcher.EventType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IWatcher.EventType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-