Class BaseNode

    • Field Detail

      • id

        protected int id
      • memoryId

        protected int memoryId
      • partitionsEnabled

        protected boolean partitionsEnabled
      • associations

        protected Bag<org.kie.api.definition.rule.Rule> associations
      • hashcode

        protected int hashcode
    • Constructor Detail

      • BaseNode

        public BaseNode()
      • BaseNode

        public BaseNode​(int id,
                        RuleBasePartitionId partitionId,
                        boolean partitionsEnabled)
        All nodes have a unique id, set in the constructor.
        Parameters:
        id - The unique id
    • Method Detail

      • getId

        public int getId()
        Description copied from interface: NetworkNode
        Returns the unique id that represents the node in the Rete network
        Specified by:
        getId in interface NetworkNode
      • setId

        public void setId​(int id)
      • getMemoryId

        public int getMemoryId()
      • initMemoryId

        protected void initMemoryId​(BuildContext context)
      • isStreamMode

        public boolean isStreamMode()
      • setStreamMode

        protected void setStreamMode​(boolean streamMode)
      • attach

        public void attach​(BuildContext context)
        Attaches the node into the network. Usually to the parent ObjectSource or TupleSource
      • networkUpdated

        public abstract void networkUpdated​(UpdateContext updateContext)
        A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state update
      • doRemove

        protected abstract boolean doRemove​(RuleRemovalContext context,
                                            ReteooBuilder builder)
        Removes the node from the network. Usually from the parent ObjectSource or TupleSource
      • isInUse

        public abstract boolean isInUse()
        Returns true in case the current node is in use (is referenced by any other node)
      • getObjectTypeNode

        public abstract ObjectTypeNode getObjectTypeNode()
      • setPartitionsEnabled

        public void setPartitionsEnabled​(boolean partitionsEnabled)
      • addAssociation

        public void addAssociation​(org.kie.api.definition.rule.Rule rule)
        Associates this node with the give rule
      • addAssociation

        public void addAssociation​(BuildContext context,
                                   org.kie.api.definition.rule.Rule rule)
      • removeAssociation

        public boolean removeAssociation​(org.kie.api.definition.rule.Rule rule)
        Removes the association to the given rule from the associations map.
      • getAssociationsSize

        public int getAssociationsSize()
        Description copied from interface: NetworkNode
        Returns how many times this nodes has been associated. Note that due to subnetworks this node could be associated to the same rule multiple times.
        Specified by:
        getAssociationsSize in interface NetworkNode
      • getAssociatedRules

        public org.kie.api.definition.rule.Rule[] getAssociatedRules()
        Specified by:
        getAssociatedRules in interface NetworkNode
      • getAssociatedRuleSize

        public int getAssociatedRuleSize()
        Description copied from interface: NetworkNode
        Returns the number of rules that are associated with this node, regardless of how many times the node is associated with a single rule.
        Specified by:
        getAssociatedRuleSize in interface NetworkNode
      • getAssociationsSize

        public int getAssociationsSize​(org.kie.api.definition.rule.Rule rule)
        Specified by:
        getAssociationsSize in interface NetworkNode
      • isAssociatedWith

        public boolean isAssociatedWith​(org.kie.api.definition.rule.Rule rule)
        Specified by:
        isAssociatedWith in interface NetworkNode
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • getSinks

        public Sink[] getSinks()