Package org.drools.core.rule
Class QueryElement
- java.lang.Object
-
- org.drools.core.rule.ConditionalElement
-
- org.drools.core.rule.QueryElement
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,RuleConditionElement,RuleComponent
public class QueryElement extends ConditionalElement implements Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryElement()QueryElement(Pattern resultPattern, String queryName, QueryArgument[] arguments, int[] variableIndexes, Declaration[] requiredDeclarations, boolean openQuery, boolean abductive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryElementclone()Returns a clone from itselfbooleanequals(Object obj)QueryArgument[]getArguments()Map<String,Declaration>getInnerDeclarations()Returns a Map of declarations that are visible inside this conditional elementList<? extends RuleConditionElement>getNestedElements()Returs a list of RuleConditionElement's that are nested inside the current elementMap<String,Declaration>getOuterDeclarations()Returns a Map of declarations that are visible outside this conditional element.StringgetQueryName()Declaration[]getRequiredDeclarations()PatterngetResultPattern()int[]getVariableIndexes()inthashCode()booleanisAbductive()booleanisOpenQuery()booleanisPatternScopeDelimiter()Returns true in case this RuleConditionElement delimits a pattern visibility scope.voidreadExternal(ObjectInput in)DeclarationresolveDeclaration(String identifier)Resolves the given identifier in the current scope and returns the Declaration object for the declaration.voidsetVariableIndexes(int[] variableIndexes)StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
QueryElement
public QueryElement()
-
QueryElement
public QueryElement(Pattern resultPattern, String queryName, QueryArgument[] arguments, int[] variableIndexes, Declaration[] requiredDeclarations, boolean openQuery, boolean abductive)
-
-
Method Detail
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
getVariableIndexes
public int[] getVariableIndexes()
-
setVariableIndexes
public void setVariableIndexes(int[] variableIndexes)
-
getQueryName
public String getQueryName()
-
getArguments
public QueryArgument[] getArguments()
-
getInnerDeclarations
public Map<String,Declaration> getInnerDeclarations()
Description copied from interface:RuleConditionElementReturns a Map of declarations that are visible inside this conditional element- Specified by:
getInnerDeclarationsin interfaceRuleConditionElement- Returns:
-
getOuterDeclarations
public Map<String,Declaration> getOuterDeclarations()
Description copied from interface:RuleConditionElementReturns a Map of declarations that are visible outside this conditional element.- Specified by:
getOuterDeclarationsin interfaceRuleConditionElement- Returns:
-
getNestedElements
public List<? extends RuleConditionElement> getNestedElements()
Description copied from interface:RuleConditionElementReturs a list of RuleConditionElement's that are nested inside the current element- Specified by:
getNestedElementsin interfaceRuleConditionElement- Returns:
-
getResultPattern
public Pattern getResultPattern()
-
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:
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
-
isOpenQuery
public boolean isOpenQuery()
-
isAbductive
public boolean isAbductive()
-
resolveDeclaration
public Declaration resolveDeclaration(String identifier)
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:
-
clone
public QueryElement clone()
Description copied from interface:RuleConditionElementReturns a clone from itself- Specified by:
clonein interfaceRuleConditionElement- Specified by:
clonein classConditionalElement- Returns:
-
-