Package jadex.rules.eca
Class MatcherNode
java.lang.Object
jadex.rules.eca.MatcherNode
The matcher node is the base class for event based rule matching.
The task is to deliver the set of rules that needs to be checked
against the event.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add a rule for event at a level.void
Add a rule to the matcher.protected void
Add a rule for an event type.protected MatcherNode
Get the child matcher node.protected MatcherNode
getOrCreateMatcherNode
(String subtype) Get or create a matcher child node.Get the rules for an event type.protected void
Get the rules for an event type at level i.Get the rules for an event type (as string, delim is .)internalGetRules
(String type) Get the directly stored rules of a matcher.static void
Main only for testing.protected void
putChild
(String type, MatcherNode node) Add a child matcher node per given subtype.protected void
removeRule
(EventType type, IRule<?> rule, int i) Remove a rule for event from a level.void
removeRule
(IRule<?> rule) Remove a rule from the matcher.protected void
removeRule
(String subtype, IRule<?> rule) Remove a rule for an event type.toString()
Get the string representation.
-
Field Details
-
children
The map of child matcher nodes. -
rules
The directly managed rule sets.
-
-
Constructor Details
-
MatcherNode
public MatcherNode()
-
-
Method Details
-
getRules
Get the rules for an event type (as string, delim is .)- Parameters:
type
- The event type.- Returns:
- The list of rules relevant for the event type.
-
getRules
Get the rules for an event type.- Parameters:
type
- The event type.- Returns:
- The list of rules relevant for the event type.
-
addRule
Add a rule to the matcher.- Parameters:
rule
- The rule.
-
removeRule
Remove a rule from the matcher.- Parameters:
rule
- The rule.
-
getRules
Get the rules for an event type at level i.- Parameters:
type
- The event type.i
- The level.
-
addRule
Add a rule for event at a level.- Parameters:
type
- The event type.rule
- The rule.i
- The level.
-
removeRule
Remove a rule for event from a level.- Parameters:
type
- The event type.rule
- The rule.i
- The level.
-
getOrCreateMatcherNode
Get or create a matcher child node.- Parameters:
subtype
- The event string for the child matcher.- Returns:
- The child matcher.
-
addRule
Add a rule for an event type.- Parameters:
subtype
- The subtype.rule
- The rule.
-
removeRule
Remove a rule for an event type.- Parameters:
subtype
- The subtype.rule
- The rule.
-
putChild
Add a child matcher node per given subtype.- Parameters:
type
- The event type.node
- The matcher node.
-
getChild
Get the child matcher node.- Parameters:
type
- The event type.- Returns:
- The child matcher.
-
internalGetRules
Get the directly stored rules of a matcher.- Parameters:
type
- The event type.- Returns:
- The list of rules.
-
toString
Get the string representation. -
main
Main only for testing.
-