Class SplitNode

    • Field Detail

      • MULTI

        public static final java.lang.String MULTI
        The constant for a multi variable.
        See Also:
        Constant Field Values
      • SINGLE

        public static final java.lang.String SINGLE
        The constant for a single variable.
        See Also:
        Constant Field Values
      • MULTI_DUMMY

        public static final java.lang.String MULTI_DUMMY
        The constant for a dummy multi variable.
        See Also:
        Constant Field Values
      • relevants

        protected volatile AttributeSet relevants
        The set of relevant attributes.
      • indirects

        protected volatile AttributeSet indirects
        The set of indirect attributes.
      • splitpattern

        protected java.lang.String[] splitpattern
        The splitpattern (multi, single or multi dummy).
      • min_values

        protected int min_values
        The minimum number of required values.
    • Constructor Detail

      • SplitNode

        public SplitNode​(int nodeid,
                         IValueExtractor extractor,
                         OAVAttributeType attr,
                         java.lang.String[] splitpattern)
        Create a new node.
        Parameters:
        state - The state.
    • Method Detail

      • modifyIndirectObject

        public void modifyIndirectObject​(java.lang.Object object,
                                         OAVAttributeType type,
                                         java.lang.Object oldvalue,
                                         java.lang.Object newvalue,
                                         IOAVState state,
                                         ReteMemory mem,
                                         AbstractAgenda agenda)
        Propagate an indirect object change to this node.
        Specified by:
        modifyIndirectObject in interface INode
        Parameters:
        object - The changed object.
      • createNodeMemory

        public java.lang.Object createNodeMemory​(IOAVState state)
        Create the node memory.
        Specified by:
        createNodeMemory in interface INode
        Parameters:
        state - The state.
        Returns:
        The node memory.
      • propagateAdditionToObjectConsumers

        protected void propagateAdditionToObjectConsumers​(java.lang.Object object,
                                                          IOAVState state,
                                                          ReteMemory mem,
                                                          AbstractAgenda agenda)
        Propagate a new object to all object consumers.
        Parameters:
        object - The new object.
      • propagateRemovalToObjectConsumers

        protected void propagateRemovalToObjectConsumers​(java.lang.Object object,
                                                         IOAVState state,
                                                         ReteMemory mem,
                                                         AbstractAgenda agenda)
        Propagate a removed object to all object consumers.
        Parameters:
        object - The new object.
      • propagateModificationToObjectConsumers

        protected void propagateModificationToObjectConsumers​(java.lang.Object object,
                                                              OAVAttributeType type,
                                                              java.lang.Object oldvalue,
                                                              java.lang.Object newvalue,
                                                              IOAVState state,
                                                              ReteMemory mem,
                                                              AbstractAgenda agenda)
        Propagate a modified object to all object consumers.
        Parameters:
        object - The new object.
      • isAffected

        public boolean isAffected​(OAVAttributeType attr)
        Test if the node is affected from a modification.
        Parameters:
        type - The attribute type.
        Returns:
        True, if possibly affected.
      • getRelevantAttributes

        public AttributeSet getRelevantAttributes()
        Get the set of relevant attribute types.
        Specified by:
        getRelevantAttributes in interface INode
        Returns:
        The relevant attribute types.
      • getIndirectAttributes

        public AttributeSet getIndirectAttributes()
        Get the set of indirect attribute types. I.e. attributes of objects, which are not part of an object conditions (e.g. for chained extractors)
        Specified by:
        getIndirectAttributes in interface INode
        Returns:
        The relevant attribute types.
      • getAttribute

        public OAVAttributeType getAttribute()
        Get the attribute.
        Returns:
        The attribute.
      • generateVirtualFacts

        protected java.util.Collection generateVirtualFacts​(java.lang.Object object,
                                                            IOAVState state)
        Generate virtual facts.
        Parameters:
        object - The object.
        state - The state.
      • generateBindings

        protected void generateBindings​(int weight,
                                        int cur,
                                        int[] binding,
                                        java.lang.Object object,
                                        java.lang.Object[] values,
                                        java.util.List ret)
        Generate all possible bindings for a list of values.
        Parameters:
        weight - The number of values to distribute on variables.
        cur - The current variable number.
        binding - Results are stored in this binding array (contains for each variable how many values it should store).
        values - The values to distribute.
        ret - The result list containing all found bindings (in form of virtual facts).
      • generateVirtualFact

        protected VirtualFact generateVirtualFact​(java.lang.Object object,
                                                  int[] binding,
                                                  java.lang.Object[] values)
        Generate a virtual fact for a found binding.
        Parameters:
        binding - The number of values for each variable.
        values - The multislot values.
        Returns:
        A virtual fact with one binding.
      • getSplitPattern

        public java.lang.String[] getSplitPattern()
        Get the split pattern.
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class AbstractNode
        Returns:
        The string representation.
      • doClone

        protected void doClone​(java.lang.Object theclone)
        Do clone makes a deep clone without regarding cycles. Method is overridden by subclasses to actually incorporate their attributes.
        Specified by:
        doClone in class AbstractNode
        Parameters:
        theclone - The clone.
      • contains

        protected boolean contains​(IOAVState state,
                                   java.util.Collection coll,
                                   java.lang.Object o)
        Check if an object is contained in a collection. Avoid the need for an "IdentityArrayList".