@PersistantProperty(property="left") @PersistantProperty(property="right") @PersistantProperty(property="operator") public class MSingleMathOperation extends AbstractReadAccessor
IReadAccessor.Standalone
Modifier and Type | Field and Description |
---|---|
protected Class<?> |
internalExpectedGenericType |
protected Class<?> |
internalExpectedType |
static String |
SINGLE_MATH_ID |
Constructor and Description |
---|
MSingleMathOperation() |
MSingleMathOperation(IReadAccessor left,
IReadAccessor right,
IMathOperator operator) |
Modifier and Type | Method and Description |
---|---|
MSingleMathOperation |
clone()
Clones the Addon.
|
<G,C extends Collection<G>> |
compileCollection(ICompilationContext ctxt,
Class<C> expectedType,
Class<G> expectedGenericType)
Implementation to handle case when expected result is a Collection.
|
void |
compileValue(ICompilationContext ctxt,
Class<?> expectedType)
Implementation to handle case when expected result is a single value.
|
boolean |
equals(Object o) |
CostInfo |
getEstimatedReadCost(ICompilationContext ctxt)
Estimates the reading complexity, to allow callers to optimize calls.
|
Class<?> |
getGenericCollectionType(IContext ctxt)
Returns the Generic type, if value is a collection or an array, evaluated :
at compilation time for standard compilation
at runtime for light compilation and execution phase
or null if the type can't be resolved or value is not a collection.
|
String |
getImplementationId()
Unique addon implementation ID.
|
Integer |
getInternalCacheIdentifier()
Returns null by default.
|
IReadAccessor |
getLeft() |
IMathOperator |
getOperator() |
IReadAccessor |
getRight() |
Class<?> |
getType(IContext ctxt)
Returns the value's class, evaluated :
at compilation time for standard compilation
at runtime for light compilation
or null if the type can't be resolved.
|
int |
hashCode() |
protected Object |
internalGet(IExecutionContext ctxt)
Specific addon implementation must be here.
|
boolean |
isCacheUsed()
Returns false by default.
|
boolean |
isInternalCacheIdentifierNeeded()
This method allows to tell the engine if a cache identifier is needed.
|
boolean |
isShouldIterate()
Always false, iteration is not handled by this accessor.
|
void |
setInternalCacheIdentifier(Integer internalIdentifier)
Stores nothing.
|
void |
setLeft(IReadAccessor left) |
void |
setOperator(IMathOperator operator) |
void |
setRight(IReadAccessor right) |
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
boolean |
wasRegistered(ICompilationContext ctxt,
IAddon parent,
AddonInfo info)
Convenience method, which does nothing.
|
castToExpected, compileRead, compileRead, compileRead, compileRead, get, getGenericTypes, isConstantValue, isShouldBeWrappedToConstantValue, isShouldNotCache
optimize, resetCachedData, toString
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
finalize, getClass, notify, notifyAll, wait, wait, wait
optimize, resetCachedData
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
public static final String SINGLE_MATH_ID
protected transient Class<?> internalExpectedType
protected transient Class<?> internalExpectedGenericType
public MSingleMathOperation()
public MSingleMathOperation(IReadAccessor left, IReadAccessor right, IMathOperator operator)
public void compileValue(ICompilationContext ctxt, Class<?> expectedType) throws MRuleValidationException
AbstractReadAccessor
compileValue
in class AbstractReadAccessor
MRuleValidationException
public <G,C extends Collection<G>> void compileCollection(ICompilationContext ctxt, Class<C> expectedType, Class<G> expectedGenericType) throws MRuleValidationException
AbstractReadAccessor
compileCollection
in class AbstractReadAccessor
MRuleValidationException
public boolean wasRegistered(ICompilationContext ctxt, IAddon parent, AddonInfo info)
AbstractAddon
wasRegistered
in interface IAddon
wasRegistered
in class AbstractAddon
parent
- Parent from which this instance of addon was registered.info
- Addon info for the currently registered addonpublic CostInfo getEstimatedReadCost(ICompilationContext ctxt) throws MRuleValidationException
IReadAccessor
ctxt
- Compilation context.MRuleValidationException
- if validation problem detected.protected Object internalGet(IExecutionContext ctxt) throws MAccessorException
AbstractReadAccessor
internalGet
in class AbstractReadAccessor
MAccessorException
public final void setInternalCacheIdentifier(Integer internalIdentifier)
AbstractAddon
setInternalCacheIdentifier
in interface IAddon
setInternalCacheIdentifier
in class AbstractAddon
internalIdentifier
- Internal identifierIAddon.getInternalCacheIdentifier()
public final Integer getInternalCacheIdentifier()
AbstractAddon
getInternalCacheIdentifier
in interface IAddon
getInternalCacheIdentifier
in class AbstractAddon
IAddon.setInternalCacheIdentifier(Integer)
public boolean isInternalCacheIdentifierNeeded()
AbstractAddon
isInternalCacheIdentifierNeeded
in interface IAddon
isInternalCacheIdentifierNeeded
in class AbstractAddon
AbstractAddon.setInternalCacheIdentifier(Integer)
public MSingleMathOperation clone()
IAddon
clone
in interface IAccessor
clone
in interface IReadAccessor
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in class AbstractReadAccessor
public boolean isCacheUsed()
AbstractAddon
isCacheUsed
in interface IAddon
isCacheUsed
in class AbstractAddon
public boolean isShouldIterate()
public Class<?> getType(IContext ctxt) throws MAccessorException
IAccessor
MAccessorException
public Class<?> getGenericCollectionType(IContext ctxt) throws MAccessorException
IAccessor
MAccessorException
public String getImplementationId()
IAddon
public void toString(OuterWithLevel outer) throws IOException
Outable
OuterWithLevel
.IOException
public IReadAccessor getLeft()
public void setLeft(IReadAccessor left)
public IReadAccessor getRight()
public void setRight(IReadAccessor right)
public IMathOperator getOperator()
public void setOperator(IMathOperator operator)