Package org.drools.core.rule
Class QueryElement
- java.lang.Object
-
- org.drools.core.rule.ConditionalElement
-
- org.drools.core.rule.QueryElement
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,RuleComponent,RuleConditionElement
public class QueryElement extends ConditionalElement implements java.io.Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryElement()QueryElement(Pattern resultPattern, java.lang.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(java.lang.Object obj)QueryArgument[]getArguments()java.util.Map<java.lang.String,Declaration>getInnerDeclarations()Returns a Map of declarations that are visible inside this conditional elementjava.util.List<? extends RuleConditionElement>getNestedElements()Returs a list of RuleConditionElement's that are nested inside the current elementjava.util.Map<java.lang.String,Declaration>getOuterDeclarations()Returns a Map of declarations that are visible outside this conditional element.java.lang.StringgetQueryName()Declaration[]getRequiredDeclarations()PatterngetResultPattern()int[]getVariableIndexes()inthashCode()booleanisAbductive()booleanisOpenQuery()booleanisPatternScopeDelimiter()Returns true in case this RuleConditionElement delimits a pattern visibility scope.voidreadExternal(java.io.ObjectInput in)DeclarationresolveDeclaration(java.lang.String identifier)Resolves the given identifier in the current scope and returns the Declaration object for the declaration.voidsetVariableIndexes(int[] variableIndexes)java.lang.StringtoString()voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Constructor Detail
-
QueryElement
public QueryElement()
-
QueryElement
public QueryElement(Pattern resultPattern, java.lang.String queryName, QueryArgument[] arguments, int[] variableIndexes, Declaration[] requiredDeclarations, boolean openQuery, boolean abductive)
-
-
Method Detail
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
getVariableIndexes
public int[] getVariableIndexes()
-
setVariableIndexes
public void setVariableIndexes(int[] variableIndexes)
-
getQueryName
public java.lang.String getQueryName()
-
getArguments
public QueryArgument[] getArguments()
-
getInnerDeclarations
public java.util.Map<java.lang.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 java.util.Map<java.lang.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 java.util.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(java.lang.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:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-