Drools :: Core 6.0.0.Beta5

org.drools.core.rule
Class Pattern

java.lang.Object
  extended by org.drools.core.rule.Pattern
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, RuleConditionElement, Acceptor, AcceptsClassObjectType, RuleComponent

public class Pattern
extends Object
implements RuleConditionElement, AcceptsClassObjectType, Externalizable

See Also:
Serialized Form

Field Summary
static String ATTR_LISTENED_PROPS
           
 
Constructor Summary
Pattern()
           
Pattern(int index, int offset, ObjectType objectType, String identifier)
           
Pattern(int index, int offset, ObjectType objectType, String identifier, boolean isInternalFact)
           
Pattern(int index, ObjectType objectType)
           
Pattern(int index, ObjectType objectType, String identifier)
           
 
Method Summary
 void addBehavior(Behavior behavior)
           
 void addConstraint(Constraint constraint)
           
 void addDeclaration(Declaration decl)
           
 Declaration addDeclaration(String identifier)
           
 Pattern clone()
          Returns a clone from itself
 boolean equals(Object object)
           
 Map<String,AnnotationDefinition> getAnnotations()
           
 List<Behavior> getBehaviors()
           
 List<MvelConstraint> getCombinableConstraints()
           
 List<Constraint> getConstraints()
           
 Declaration getDeclaration()
           
 Declaration getDeclaration(String identifier)
           
 int getIndex()
           
 Map<String,Declaration> getInnerDeclarations()
          Returns a Map of declarations that are visible inside this conditional element
 List<String> getListenedProperties()
           
 List getNestedElements()
          Returs a list of RuleConditionElement's that are nested inside the current element
 ObjectType getObjectType()
           
 int getOffset()
          The offset of the fact related to this pattern inside the tuple
 Map<String,Declaration> getOuterDeclarations()
          Returns a Map of declarations that are visible outside this conditional element.
static InternalReadAccessor getReadAcessor(ObjectType objectType)
           
 Declaration[] getRequiredDeclarations()
           
 PatternSource getSource()
           
 int hashCode()
           
 boolean isBound()
           
 boolean isPatternScopeDelimiter()
          Returns true in case this RuleConditionElement delimits a pattern visibility scope.
 void readExternal(ObjectInput in)
           
 void removeConstraint(Constraint constraint)
           
 Declaration resolveDeclaration(String identifier)
          Resolves the given identifier in the current scope and returns the Declaration object for the declaration.
 void setAnnotations(Map<String,AnnotationDefinition> annotations)
           
 void setBehaviors(List<Behavior> behaviors)
           
 void setClassObjectType(ClassObjectType objectType)
           
 void setListenedProperties(List<String> listenedProperties)
           
 void setObjectType(ObjectType objectType)
           
 void setOffset(int offset)
           
 void setSource(PatternSource source)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_LISTENED_PROPS

public static final String ATTR_LISTENED_PROPS
See Also:
Constant Field Values
Constructor Detail

Pattern

public Pattern()

Pattern

public Pattern(int index,
               ObjectType objectType)

Pattern

public Pattern(int index,
               ObjectType objectType,
               String identifier)

Pattern

public Pattern(int index,
               int offset,
               ObjectType objectType,
               String identifier)

Pattern

public Pattern(int index,
               int offset,
               ObjectType objectType,
               String identifier,
               boolean isInternalFact)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

getReadAcessor

public static InternalReadAccessor getReadAcessor(ObjectType objectType)

setClassObjectType

public void setClassObjectType(ClassObjectType objectType)
Specified by:
setClassObjectType in interface AcceptsClassObjectType

getRequiredDeclarations

public Declaration[] getRequiredDeclarations()

clone

public Pattern clone()
Description copied from interface: RuleConditionElement
Returns a clone from itself

Specified by:
clone in interface RuleConditionElement
Overrides:
clone in class Object
Returns:

getObjectType

public ObjectType getObjectType()

setObjectType

public void setObjectType(ObjectType objectType)

getSource

public PatternSource getSource()

setSource

public void setSource(PatternSource source)

getConstraints

public List<Constraint> getConstraints()

addConstraint

public void addConstraint(Constraint constraint)

removeConstraint

public void removeConstraint(Constraint constraint)

getCombinableConstraints

public List<MvelConstraint> getCombinableConstraints()

addDeclaration

public Declaration addDeclaration(String identifier)

addDeclaration

public void addDeclaration(Declaration decl)

isBound

public boolean isBound()

getDeclaration

public Declaration getDeclaration()

getDeclaration

public Declaration getDeclaration(String identifier)

getIndex

public int getIndex()

getOffset

public int getOffset()
The offset of the fact related to this pattern inside the tuple

Returns:
the offset

setOffset

public void setOffset(int offset)

getInnerDeclarations

public Map<String,Declaration> getInnerDeclarations()
Description copied from interface: RuleConditionElement
Returns a Map of declarations that are visible inside this conditional element

Specified by:
getInnerDeclarations in interface RuleConditionElement
Returns:

getOuterDeclarations

public Map<String,Declaration> getOuterDeclarations()
Description copied from interface: RuleConditionElement
Returns a Map of declarations that are visible outside this conditional element.

Specified by:
getOuterDeclarations in interface RuleConditionElement
Returns:

resolveDeclaration

public Declaration resolveDeclaration(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 String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

getNestedElements

public List getNestedElements()
Description copied from interface: RuleConditionElement
Returs a list of RuleConditionElement's that are nested inside the current element

Specified by:
getNestedElements in interface RuleConditionElement
Returns:

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 List<Behavior> getBehaviors()
Returns:
the behaviors

setBehaviors

public void setBehaviors(List<Behavior> behaviors)
Parameters:
behaviors - the behaviors to set

addBehavior

public void addBehavior(Behavior behavior)

getListenedProperties

public List<String> getListenedProperties()

setListenedProperties

public void setListenedProperties(List<String> listenedProperties)

getAnnotations

public Map<String,AnnotationDefinition> getAnnotations()

setAnnotations

public void setAnnotations(Map<String,AnnotationDefinition> annotations)

Drools :: Core 6.0.0.Beta5

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.