Class TupleStartEqualsConstraint

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, org.drools.base.rule.constraint.BetaNodeFieldConstraint, org.drools.base.rule.constraint.Constraint, org.drools.base.rule.RuleComponent

    public class TupleStartEqualsConstraint
    extends java.lang.Object
    implements org.drools.base.rule.constraint.BetaNodeFieldConstraint
    Checks if one tuple is the start subtuple of other tuple. For instance, if we have two tuples: T1 = [ a, b, c ] T2 = [ a, b, c, d, e] This constraint will evaluate to true as T1 is the starting subtuple of T2. On the other hand, if we have: T1 = [ a, c, b ] T2 = [ a, b, c, d, e ] This constraint will evaluate to false, as T1 is not the starting subtuple of T2. Besides having the same elements, the order is different. This constraint is used when joining subnetworks back into the main network.
    See Also:
    Serialized Form
    • Constructor Detail

      • TupleStartEqualsConstraint

        public TupleStartEqualsConstraint()
    • Method Detail

      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • getRequiredDeclarations

        public org.drools.base.rule.Declaration[] getRequiredDeclarations()
        Specified by:
        getRequiredDeclarations in interface org.drools.base.rule.constraint.Constraint
      • replaceDeclaration

        public void replaceDeclaration​(org.drools.base.rule.Declaration oldDecl,
                                       org.drools.base.rule.Declaration newDecl)
        Specified by:
        replaceDeclaration in interface org.drools.base.rule.constraint.Constraint
      • isTemporal

        public boolean isTemporal()
        Specified by:
        isTemporal in interface org.drools.base.rule.constraint.Constraint
      • createContextEntry

        public org.drools.base.rule.ContextEntry createContextEntry()
        Specified by:
        createContextEntry in interface org.drools.base.rule.constraint.BetaNodeFieldConstraint
      • isAllowedCachedLeft

        public boolean isAllowedCachedLeft​(org.drools.base.rule.ContextEntry context,
                                           org.kie.api.runtime.rule.FactHandle handle)
        Specified by:
        isAllowedCachedLeft in interface org.drools.base.rule.constraint.BetaNodeFieldConstraint
      • isAllowedCachedRight

        public boolean isAllowedCachedRight​(org.drools.base.reteoo.BaseTuple tuple,
                                            org.drools.base.rule.ContextEntry context)
        Specified by:
        isAllowedCachedRight in interface org.drools.base.rule.constraint.BetaNodeFieldConstraint
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • clone

        public TupleStartEqualsConstraint clone()
        Specified by:
        clone in interface org.drools.base.rule.constraint.Constraint
        Overrides:
        clone in class java.lang.Object
      • getType

        public org.drools.base.rule.constraint.Constraint.ConstraintType getType()
        Specified by:
        getType in interface org.drools.base.rule.constraint.Constraint
      • cloneIfInUse

        public org.drools.base.rule.constraint.BetaNodeFieldConstraint cloneIfInUse()
        Specified by:
        cloneIfInUse in interface org.drools.base.rule.constraint.BetaNodeFieldConstraint