Class Pattern

    • Constructor Detail

      • Pattern

        public Pattern()
      • Pattern

        public Pattern​(int patternId,
                       ObjectType objectType)
      • Pattern

        public Pattern​(int patternId,
                       ObjectType objectType,
                       java.lang.String identifier)
      • Pattern

        public Pattern​(int patternId,
                       int tupleIndex,
                       int objectIndex,
                       ObjectType objectType,
                       java.lang.String identifier)
      • Pattern

        public Pattern​(int patternId,
                       int tupleIndex,
                       int objectIndex,
                       ObjectType objectType,
                       java.lang.String identifier,
                       boolean isInternalFact)
    • Method Detail

      • hasNegativeConstraint

        public boolean hasNegativeConstraint()
      • setHasNegativeConstraint

        public void setHasNegativeConstraint​(boolean negative)
      • 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()
      • getObjectType

        public ObjectType getObjectType()
      • setObjectType

        public void setObjectType​(ObjectType objectType)
      • isPassive

        public boolean isPassive()
      • setPassive

        public void setPassive​(boolean passive)
      • getConstraints

        public java.util.List<Constraint> getConstraints()
      • addConstraint

        public void addConstraint​(int index,
                                  Constraint constraint)
      • addConstraints

        public void addConstraints​(java.util.Collection<Constraint> constraints)
      • addConstraint

        public void addConstraint​(Constraint constraint)
      • hasXPath

        public boolean hasXPath()
      • getXPathDeclaration

        public Declaration getXPathDeclaration()
      • addDeclaration

        public Declaration addDeclaration​(java.lang.String identifier)
      • addDeclaration

        public void addDeclaration​(Declaration decl)
      • resetDeclarations

        public void resetDeclarations()
      • isBound

        public boolean isBound()
      • getPatternId

        public int getPatternId()
        The index of the Pattern, in the list of patterns.
        Returns:
        the patternIndex
      • getObjectIndex

        public int getObjectIndex()
      • setObjectIndex

        public void setObjectIndex​(int objectIndex)
      • getTupleIndex

        public int getTupleIndex()
        The index of pattern in the tuple chain.
        Returns:
        the tupleIndex
      • setTupleIndex

        public void setTupleIndex​(int tupleIndex)
      • getDeclarations

        public java.util.Map<java.lang.String,​Declaration> getDeclarations()
      • resolveDeclaration

        public Declaration resolveDeclaration​(java.lang.String identifier)
        Description copied from interface: RuleConditionElement
        Resolves the given identifier in the current scope and returns the Declaration object for the declaration. Returns null if identifier can not be resolved.
        Specified by:
        resolveDeclaration in interface RuleConditionElement
        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
      • isPatternScopeDelimiter

        public boolean isPatternScopeDelimiter()
        Description copied from interface: RuleConditionElement
        Returns true in case this RuleConditionElement delimits a pattern visibility scope. For instance, AND CE is not a scope delimiter, while NOT CE is a scope delimiter
        Specified by:
        isPatternScopeDelimiter in interface RuleConditionElement
        Returns:
      • getBehaviors

        public java.util.List<Behavior> getBehaviors()
        Returns:
        the behaviors
      • setBehaviors

        public void setBehaviors​(java.util.List<Behavior> behaviors)
        Parameters:
        behaviors - the behaviors to set
      • addBehavior

        public void addBehavior​(Behavior behavior)
      • getListenedProperties

        public java.util.Collection<java.lang.String> getListenedProperties()
      • addBoundProperty

        public void addBoundProperty​(java.lang.String boundProperty)
      • addWatchedProperty

        public void addWatchedProperty​(java.lang.String watchedProperty)
      • addWatchedProperties

        public void addWatchedProperties​(java.util.Collection<java.lang.String> watchedProperties)
      • getAccessibleProperties

        public java.util.List<java.lang.String> getAccessibleProperties​(RuleBase ruleBase)
      • getPositiveWatchMask

        public org.drools.core.util.bitmask.BitMask getPositiveWatchMask​(java.util.List<java.lang.String> accessibleProperties)
      • setPositiveWatchMask

        public void setPositiveWatchMask​(org.drools.core.util.bitmask.BitMask positiveWatchMask)
      • getNegativeWatchMask

        public org.drools.core.util.bitmask.BitMask getNegativeWatchMask​(java.util.List<java.lang.String> accessibleProperties)
      • setNegativeWatchMask

        public void setNegativeWatchMask​(org.drools.core.util.bitmask.BitMask negativeWatchMask)
      • setBackRefDeclarations

        public void setBackRefDeclarations​(XpathBackReference backRefDeclarations)
      • getXpathBackReferenceClasses

        public java.util.List<java.lang.Class<?>> getXpathBackReferenceClasses()
      • isCompatibleWithAccumulateReturnType

        public boolean isCompatibleWithAccumulateReturnType​(java.lang.Class<?> returnType)
      • isCompatibleWithFromReturnType

        public boolean isCompatibleWithFromReturnType​(java.lang.Class<?> returnType)
      • isCompatibleWithAccumulateReturnType

        public static boolean isCompatibleWithAccumulateReturnType​(java.lang.Class<?> patternType,
                                                                   java.lang.Class<?> returnType)
      • isCompatibleWithFromReturnType

        public static boolean isCompatibleWithFromReturnType​(java.lang.Class<?> patternType,
                                                             java.lang.Class<?> returnType)