public class MatcherNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,MatcherNode> |
children
The map of child matcher nodes.
|
protected java.util.Map<java.lang.String,java.util.List<IRule<?>>> |
rules
The directly managed rule sets.
|
Constructor and Description |
---|
MatcherNode() |
Modifier and Type | Method and Description |
---|---|
protected void |
addRule(EventType type,
IRule<?> rule,
int i)
Add a rule for event at a level.
|
void |
addRule(IRule<?> rule)
Add a rule to the matcher.
|
protected void |
addRule(java.lang.String subtype,
IRule<?> rule)
Add a rule for an event type.
|
protected MatcherNode |
getChild(java.lang.String type)
Get the child matcher node.
|
protected MatcherNode |
getOrCreateMatcherNode(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 void |
getRules(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 void |
main(java.lang.String[] args)
Main only for testing.
|
protected void |
putChild(java.lang.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(java.lang.String subtype,
IRule<?> rule)
Remove a rule for an event type.
|
java.lang.String |
toString()
Get the string representation.
|
protected java.util.Map<java.lang.String,MatcherNode> children
protected java.util.Map<java.lang.String,java.util.List<IRule<?>>> rules
public java.util.List<IRule<?>> getRules(java.lang.String type)
type
- The event type.public java.util.List<IRule<?>> getRules(EventType type)
type
- The event type.public void addRule(IRule<?> rule)
rule
- The rule.public void removeRule(IRule<?> rule)
rule
- The rule.protected void getRules(EventType type, int i, java.util.List<IRule<?>> ret)
type
- The event type.i
- The level.protected void addRule(EventType type, IRule<?> rule, int i)
type
- The event type.rule
- The rule.i
- The level.protected void removeRule(EventType type, IRule<?> rule, int i)
type
- The event type.rule
- The rule.i
- The level.protected MatcherNode getOrCreateMatcherNode(java.lang.String subtype)
subtype
- The event string for the child matcher.protected void addRule(java.lang.String subtype, IRule<?> rule)
subtype
- The subtype.rule
- The rule.protected void removeRule(java.lang.String subtype, IRule<?> rule)
subtype
- The subtype.rule
- The rule.protected void putChild(java.lang.String type, MatcherNode node)
type
- The event type.node
- The matcher node.protected MatcherNode getChild(java.lang.String type)
type
- The event type.protected java.util.List<IRule<?>> internalGetRules(java.lang.String type)
type
- The event type.public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)