Enum Class IWatcher.EventType
- All Implemented Interfaces:
Serializable
,Comparable<IWatcher.EventType>
,Constable
- Enclosing interface:
IWatcher
Constants that defines the type of event the event module can handle.
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.
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.
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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic IWatcher.EventType
Returns the enum constant of this class with the specified name.static IWatcher.EventType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FACT_CHECKING
-
NEW_CLASS_INSTANCE
-
NEW_INSTANCE
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-