Package jadex.rules.eca
Class MatcherNode
- java.lang.Object
- 
- jadex.rules.eca.MatcherNode
 
- 
 public class MatcherNode extends java.lang.ObjectThe 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 SummaryFields Modifier and Type Field Description protected java.util.Map<java.lang.String,MatcherNode>childrenThe map of child matcher nodes.protected java.util.Map<java.lang.String,java.util.List<IRule<?>>>rulesThe directly managed rule sets.
 - 
Constructor SummaryConstructors Constructor Description MatcherNode()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRule(EventType type, IRule<?> rule, int i)Add a rule for event at a level.voidaddRule(IRule<?> rule)Add a rule to the matcher.protected voidaddRule(java.lang.String subtype, IRule<?> rule)Add a rule for an event type.protected MatcherNodegetChild(java.lang.String type)Get the child matcher node.protected MatcherNodegetOrCreateMatcherNode(java.lang.String subtype)Get or create a matcher child node.java.util.List<IRule<?>>getRules(EventType type)Get the rules for an event type.protected voidgetRules(EventType type, int i, java.util.List<IRule<?>> ret)Get the rules for an event type at level i.java.util.List<IRule<?>>getRules(java.lang.String type)Get the rules for an event type (as string, delim is .)protected java.util.List<IRule<?>>internalGetRules(java.lang.String type)Get the directly stored rules of a matcher.static voidmain(java.lang.String[] args)Main only for testing.protected voidputChild(java.lang.String type, MatcherNode node)Add a child matcher node per given subtype.protected voidremoveRule(EventType type, IRule<?> rule, int i)Remove a rule for event from a level.voidremoveRule(IRule<?> rule)Remove a rule from the matcher.protected voidremoveRule(java.lang.String subtype, IRule<?> rule)Remove a rule for an event type.java.lang.StringtoString()Get the string representation.
 
- 
- 
- 
Field Detail- 
childrenprotected java.util.Map<java.lang.String,MatcherNode> children The map of child matcher nodes.
 - 
rulesprotected java.util.Map<java.lang.String,java.util.List<IRule<?>>> rules The directly managed rule sets.
 
- 
 - 
Method Detail- 
getRulespublic java.util.List<IRule<?>> getRules(java.lang.String type) 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.
 
 - 
getRulespublic java.util.List<IRule<?>> getRules(EventType type) Get the rules for an event type.- Parameters:
- type- The event type.
- Returns:
- The list of rules relevant for the event type.
 
 - 
addRulepublic void addRule(IRule<?> rule) Add a rule to the matcher.- Parameters:
- rule- The rule.
 
 - 
removeRulepublic void removeRule(IRule<?> rule) Remove a rule from the matcher.- Parameters:
- rule- The rule.
 
 - 
getRulesprotected void getRules(EventType type, int i, java.util.List<IRule<?>> ret) Get the rules for an event type at level i.- Parameters:
- type- The event type.
- i- The level.
 
 - 
addRuleprotected void addRule(EventType type, IRule<?> rule, int i) Add a rule for event at a level.- Parameters:
- type- The event type.
- rule- The rule.
- i- The level.
 
 - 
removeRuleprotected void removeRule(EventType type, IRule<?> rule, int i) Remove a rule for event from a level.- Parameters:
- type- The event type.
- rule- The rule.
- i- The level.
 
 - 
getOrCreateMatcherNodeprotected MatcherNode getOrCreateMatcherNode(java.lang.String subtype) Get or create a matcher child node.- Parameters:
- subtype- The event string for the child matcher.
- Returns:
- The child matcher.
 
 - 
addRuleprotected void addRule(java.lang.String subtype, IRule<?> rule)Add a rule for an event type.- Parameters:
- subtype- The subtype.
- rule- The rule.
 
 - 
removeRuleprotected void removeRule(java.lang.String subtype, IRule<?> rule)Remove a rule for an event type.- Parameters:
- subtype- The subtype.
- rule- The rule.
 
 - 
putChildprotected void putChild(java.lang.String type, MatcherNode node)Add a child matcher node per given subtype.- Parameters:
- type- The event type.
- node- The matcher node.
 
 - 
getChildprotected MatcherNode getChild(java.lang.String type) Get the child matcher node.- Parameters:
- type- The event type.
- Returns:
- The child matcher.
 
 - 
internalGetRulesprotected java.util.List<IRule<?>> internalGetRules(java.lang.String type) Get the directly stored rules of a matcher.- Parameters:
- type- The event type.
- Returns:
- The list of rules.
 
 - 
toStringpublic java.lang.String toString() Get the string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 - 
mainpublic static void main(java.lang.String[] args) Main only for testing.
 
- 
 
-