public abstract class AbstractCondition extends AbstractAddon implements ICondition
Constructor and Description |
---|
AbstractCondition() |
Modifier and Type | Method and Description |
---|---|
AbstractCondition |
clone()
Clones the Addon.
|
ICondition |
combine(ILogicalOperator operator,
ICondition condition)
Combines using MConditionSet.
|
protected ICondition |
combineToNewSet(ILogicalOperator operator,
ICondition condition)
Combines using a newly created MConditionSet.
|
boolean |
equals(Object o)
Tests the "not" flag only. pEquals must be overridden to test other parameters.
|
boolean |
evaluate(IExecutionContext ctxt)
This method handles in / out logging and redirects to
pEvaluate(IExecutionContext) for specific implementation. |
int |
hashCode()
Computes hashCode on the "not" flag only. pEquals must be overridden to test other parameters.
|
protected abstract ConditionEquivalence |
internalIsEquivalent(ICondition o)
Called by
internalIsEquivalent(ICondition) if the other condition is not an instance of MConditionNot . |
ConditionEquivalence |
isEquivalent(ICondition o)
Handles the facts that provided condition is null or an instance of
MConditionNot . |
boolean |
isNot()
Allows to invert condition's behavior.
|
boolean |
isShouldBeWrappedToConstantValue()
Default implementation returns
ICondition.isConstantValue() . |
protected abstract boolean |
pEquals(AbstractCondition o)
Tests equality on other parameters than "not".
|
protected abstract boolean |
pEvaluate(IExecutionContext ctxt) |
protected abstract int |
pHashCode()
Computes hashCode on other parameters than "not".
|
protected abstract void |
pToString(OuterWithLevel outer)
Finishes toString output.
|
void |
setNot(boolean not)
Allows to invert condition's behavior.
|
void |
toString(OuterWithLevel outer)
Encapsulates output with parenthesis and not flag.
|
getInternalCacheIdentifier, isCacheUsed, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, toString, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
finalize, getClass, notify, notifyAll, wait, wait, wait
compile, getEstimatedCost, isConstantValue
getImplementationId, getInternalCacheIdentifier, isCacheUsed, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
public boolean evaluate(IExecutionContext ctxt) throws MConditionEvaluationException
pEvaluate(IExecutionContext)
for specific implementation.evaluate
in interface ICondition
MConditionEvaluationException
protected abstract boolean pEvaluate(IExecutionContext ctxt) throws MConditionEvaluationException
MConditionEvaluationException
public AbstractCondition clone()
IAddon
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in interface ICondition
clone
in class AbstractAddon
public boolean isShouldBeWrappedToConstantValue()
ICondition.isConstantValue()
.isShouldBeWrappedToConstantValue
in interface ICondition
public ConditionEquivalence isEquivalent(ICondition o)
MConditionNot
.
Otherwise returns null.isEquivalent
in interface ICondition
protected abstract ConditionEquivalence internalIsEquivalent(ICondition o)
internalIsEquivalent(ICondition)
if the other condition is not an instance of MConditionNot
.public final void toString(OuterWithLevel outer) throws IOException
toString
in interface Outable
IOException
protected abstract void pToString(OuterWithLevel outer) throws IOException
IOException
public final boolean equals(Object o)
protected abstract boolean pEquals(AbstractCondition o)
public final int hashCode()
protected abstract int pHashCode()
public boolean isNot()
isNot
in interface ICondition
public void setNot(boolean not)
setNot
in interface ICondition
public ICondition combine(ILogicalOperator operator, ICondition condition)
combine
in interface ICondition
operator
- Operator to use to combine the results.condition
- Condition to combine withprotected ICondition combineToNewSet(ILogicalOperator operator, ICondition condition)