Package org.drools.base.rule
Class GroupElement
java.lang.Object
org.drools.base.rule.ConditionalElement
org.drools.base.rule.GroupElement
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,RuleComponent,RuleConditionElement
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GroupElement.Typestatic final GroupElement.Typestatic final GroupElement.Typestatic final GroupElement.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(int index, RuleConditionElement rce) Adds the given child as the (index)th child of the this GroupElementaddChild(RuleConditionElement child) Adds a child to the current GroupElement.clone()Clones all Conditional Elements but references the non ConditionalElement childrenprotected GroupElementclone(boolean deepClone) booleanbooleanReturns a Map of declarations that are visible inside this conditional elementgetInnerDeclarations(String consequenceName) Returs a list of RuleConditionElement's that are nested inside the current elementReturns a Map of declarations that are visible outside this conditional element.getOuterDeclarations(String consequenceName) getType()inthashCode()booleanisAnd()booleanisExists()booleanisNot()booleanisOr()booleanReturns true in case this RuleConditionElement delimits a pattern visibility scope.booleanisRoot()protected voidmergeGroupElements(GroupElement parent, GroupElement child) voidpack()Optimize the group element subtree by removing redundancies like an AND inside another AND, OR inside OR, single branches AND/OR, etc.voidpack(GroupElement parent) voidresolveDeclaration(String identifier) Resolves the given identifier in the current scope and returns the Declaration object for the declaration.voidsetRoot(boolean root) voidsetType(GroupElement.Type type) toString()void
-
Field Details
-
AND
-
OR
-
NOT
-
EXISTS
-
-
Constructor Details
-
GroupElement
public GroupElement() -
GroupElement
-
-
Method Details
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
addChild
Adds a child to the current GroupElement. Restrictions are: NOT/EXISTS: can have only one child, either a single Pattern or another CE -
addChild
Adds the given child as the (index)th child of the this GroupElement -
getChildren
-
getInnerDeclarations
Description copied from interface:RuleConditionElementReturns a Map of declarations that are visible inside this conditional element- Specified by:
getInnerDeclarationsin interfaceRuleConditionElement- Returns:
-
getInnerDeclarations
-
getOuterDeclarations
Description copied from interface:RuleConditionElementReturns a Map of declarations that are visible outside this conditional element.- Specified by:
getOuterDeclarationsin interfaceRuleConditionElement- Returns:
-
getOuterDeclarations
-
resolveDeclaration
Description copied from interface:RuleConditionElementResolves 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:
resolveDeclarationin interfaceRuleConditionElement- Returns:
-
pack
public void pack()Optimize the group element subtree by removing redundancies like an AND inside another AND, OR inside OR, single branches AND/OR, etc. LogicTransformer does further, more complicated, transformations -
mergeGroupElements
-
pack
-
equals
-
hashCode
public int hashCode() -
clone
Clones all Conditional Elements but references the non ConditionalElement children- Specified by:
clonein interfaceRuleConditionElement- Specified by:
clonein classConditionalElement- Returns:
-
cloneOnlyGroup
-
clone
-
getType
-
setType
-
isAnd
public boolean isAnd() -
isOr
public boolean isOr() -
isNot
public boolean isNot() -
isExists
public boolean isExists() -
toString
-
getNestedElements
Description copied from interface:RuleConditionElementReturs a list of RuleConditionElement's that are nested inside the current element- Specified by:
getNestedElementsin interfaceRuleConditionElement- Returns:
-
isPatternScopeDelimiter
public boolean isPatternScopeDelimiter()Description copied from interface:RuleConditionElementReturns 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:
isPatternScopeDelimiterin interfaceRuleConditionElement- Returns:
-
isRoot
public boolean isRoot() -
setRoot
public void setRoot(boolean root) -
containesNode
-