org.drools.rule
Class LiteralConstraint
java.lang.Object
org.drools.rule.LiteralConstraint
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, AlphaNodeFieldConstraint, Constraint, RuleComponent
public class LiteralConstraint
- extends java.lang.Object
- implements AlphaNodeFieldConstraint
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
LiteralConstraint
public LiteralConstraint(FieldExtractor extractor,
Evaluator evaluator,
FieldValue field)
LiteralConstraint
public LiteralConstraint(FieldExtractor extractor,
LiteralRestriction restriction)
getEvaluator
public Evaluator getEvaluator()
getField
public FieldValue getField()
getFieldExtractor
public FieldExtractor getFieldExtractor()
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
- Literal constraints cannot have required declarations, so always return an empty array.
- Specified by:
getRequiredDeclarations
in interface Constraint
- Returns:
- Return an empty
Declaration[]
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl,
Declaration newDecl)
- Description copied from interface:
Constraint
- A constraint may be required to replace an old
declaration object by a new updated one
- Specified by:
replaceDeclaration
in interface Constraint
isAllowed
public boolean isAllowed(java.lang.Object object,
InternalWorkingMemory workingMemory,
ContextEntry ctx)
- Specified by:
isAllowed
in interface AlphaNodeFieldConstraint
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
clone
public java.lang.Object clone()
- Description copied from interface:
Constraint
- Clones the constraint
- Specified by:
clone
in interface Constraint
- Overrides:
clone
in class java.lang.Object
- Returns:
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntry
in interface AlphaNodeFieldConstraint
getType
public Constraint.ConstraintType getType()
- Description copied from interface:
Constraint
- Returns the type of the constraint, either ALPHA, BETA or UNKNOWN
- Specified by:
getType
in interface Constraint
- Returns: