Class TupleStartEqualsConstraint

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, BetaNodeFieldConstraint, Constraint, RuleComponent

    public class TupleStartEqualsConstraint
    extends java.lang.Object
    implements 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 Declaration[] getRequiredDeclarations()
        Description copied from interface: Constraint
        Returns all the declarations required by the given constraint implementation.
        Specified by:
        getRequiredDeclarations in interface Constraint
        Returns:
      • replaceDeclaration

        public void replaceDeclaration​(Declaration oldDecl,
                                       Declaration newDecl)
        Description copied from interface: Constraint
        When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch. Since this is done at ReteOO build type, when constraints were already created, eventually some constraints need to update their references to the declarations.
        Specified by:
        replaceDeclaration in interface Constraint
      • isTemporal

        public boolean isTemporal()
        Description copied from interface: Constraint
        Returns true in case this constraint is a temporal constraint
        Specified by:
        isTemporal in interface Constraint
        Returns:
      • 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