Class Rulebase

  • All Implemented Interfaces:
    IRulebase

    public class Rulebase
    extends java.lang.Object
    implements IRulebase
    Rulebase implementation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected MatcherNode matcher
      The rule matcher node.
      protected java.util.Map<java.lang.String,​IRule<?>> rules
      The rules per name.
    • Constructor Summary

      Constructors 
      Constructor Description
      Rulebase()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRule​(IRule<?> rule)
      Add a new rule.
      boolean containsRule​(java.lang.String name)
      Test if a rule is contained in the rule base.
      IRule<?> getRule​(java.lang.String name)
      Get the rule.
      java.util.Collection<IRule<?>> getRules()
      Get all rules.
      java.util.List<IRule<?>> getRules​(EventType event)
      Get all rules that are relevant for an event type.
      void removeRule​(java.lang.String rulename)
      Remove a rule.
      void updateRule​(IRule<?> rule)
      Update a rule.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • rules

        protected java.util.Map<java.lang.String,​IRule<?>> rules
        The rules per name.
      • matcher

        protected MatcherNode matcher
        The rule matcher node.
    • Constructor Detail

      • Rulebase

        public Rulebase()
    • Method Detail

      • addRule

        public void addRule​(IRule<?> rule)
        Add a new rule.
        Specified by:
        addRule in interface IRulebase
        Parameters:
        rule - The rule.
      • removeRule

        public void removeRule​(java.lang.String rulename)
        Remove a rule.
        Specified by:
        removeRule in interface IRulebase
        Parameters:
        rule - The rule.
      • updateRule

        public void updateRule​(IRule<?> rule)
        Update a rule.
        Specified by:
        updateRule in interface IRulebase
        Parameters:
        rule - The rule.
      • getRules

        public java.util.List<IRule<?>> getRules​(EventType event)
        Get all rules that are relevant for an event type.
        Specified by:
        getRules in interface IRulebase
        Parameters:
        event - The event type.
        Returns:
        The rules.
      • getRule

        public IRule<?> getRule​(java.lang.String name)
        Get the rule.
        Specified by:
        getRule in interface IRulebase
        Parameters:
        event - The rule name.
        Returns:
        The rule.
      • containsRule

        public boolean containsRule​(java.lang.String name)
        Test if a rule is contained in the rule base.
        Specified by:
        containsRule in interface IRulebase
        Parameters:
        name - The rule name.
        Returns:
        True, if contained.
      • getRules

        public java.util.Collection<IRule<?>> getRules()
        Get all rules.
        Specified by:
        getRules in interface IRulebase
        Returns:
        The rules.