Class NFERuleInstance

  • All Implemented Interfaces:
    NFEModelObject

    public class NFERuleInstance
    extends NFEBasicModelObject
    Represents a materialization of a rule. A rule instance is created every time a rule is applied to a set of feature element.
    • Constructor Detail

      • NFERuleInstance

        public NFERuleInstance()
        Allocates a new rule instance
    • Method Detail

      • getRulesModel

        public NFERulesModel getRulesModel()
        Gets the current rules model
        Returns:
        a rules model instance
      • setRulesModel

        public void setRulesModel​(NFERulesModel rulesModel)
        Sets the current rules model instance
        Parameters:
        rulesModel - a rules model instance
      • getId

        public long getId()
        Gets the rule instance id
        Returns:
        a rule instance id
      • setId

        public void setId​(long id)
        Sets the rule instance id
        Parameters:
        id - a rule instance id
      • getRuleId

        public long getRuleId()
        Gets the rule instance's rule id
        Returns:
        a rule id
      • setRuleId

        public void setRuleId​(long ruleId)
        Sets the rule instance's rule id
        Parameters:
        ruleId - a rule id
      • addRelation

        public boolean addRelation​(NFERuleInstanceRelation relation)
        Adds a relation to a feature element. This method is useful when an existing rule instance representation is created.
        Parameters:
        relation - an object defining the relationship between the rule instance and the feature element
        Returns:
        true if the relation was added
      • addFeatureElementRelation

        public boolean addFeatureElementRelation​(NFEFeatureElement featElem)
        Adds a relation to the feature element
        Parameters:
        featElem - a feature element
        Returns:
        true if the relation was added
      • removeFeatureElementRelation

        public boolean removeFeatureElementRelation​(NFEFeatureElement featElem)
        Removes the relation with the feature element
        Parameters:
        featElem - a feature element
        Returns:
        true if the relation was removed
      • getRelatedFeatureElements

        public java.util.Collection<NFEFeatureElement> getRelatedFeatureElements()
        Gets all the feature elements currently related to this rule instance
        Returns:
        a colleciton of feature elements
      • isRelatedToFeatureElement

        public boolean isRelatedToFeatureElement​(NFEFeatureElement featElem)
        Tells whether the given feature element is related to the rule instance
        Parameters:
        featElem - a feature element
        Returns:
        true if the feature element is related to the rule instance
      • getRelations

        public java.util.Collection<NFERuleInstanceRelation> getRelations()
        Gets all the feature element relations.
        Returns:
        a collection of rule instance relation objects
      • getRelationsCount

        public int getRelationsCount()
        Gets the number of related feature elements
        Returns:
        the number of related feature elements