|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.expression.Expression
public abstract class Expression
This class represents an expression. Value type is int
by
default but it can also be an object. If the method getObject()
is not overridden, the given object value will be the Integer
representation of the int
value.
Method Summary | |
---|---|
boolean |
canBePreempted()
Return true if the associated value can be evaluated without ability context. |
void |
extractTriggeredEvents(java.util.List<MEventListener> res,
MCard source,
Test globalTest)
Adds to the specified list, the events modifying the result of this test. |
Expression |
getConstraintExpression(java.util.Map<java.lang.String,Expression> values)
Returns this expression where values depending on values of this action have been replaced. |
java.lang.Object |
getObject(Ability ability,
Targetable tested,
ContextEventListener context)
Returns the object value of this expression. |
java.lang.Class<?> |
getObjectClass()
Returns the class of the object value of this expression. |
int |
getPreemptionValue(Ability ability,
Targetable tested,
ContextEventListener context)
Returns the integer value of this expression exactly as it will be when the ability will be executed. |
abstract int |
getValue(Ability ability,
Targetable tested,
ContextEventListener context)
Returns the integer value of this expression |
boolean |
isConstant()
Is this expression is a constant. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.Object getObject(Ability ability, Targetable tested, ContextEventListener context)
ability
- the ability owning this test. The card component of this ability
should correspond tho the card owning this test too.tested
- the tested cardcontext
- the context event listener
public java.lang.Class<?> getObjectClass()
public abstract int getValue(Ability ability, Targetable tested, ContextEventListener context)
ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.tested
- the tested cardcontext
- is the context attached to this test.
public int getPreemptionValue(Ability ability, Targetable tested, ContextEventListener context)
ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.tested
- the tested cardcontext
- is the context attached to this test.
public Expression getConstraintExpression(java.util.Map<java.lang.String,Expression> values)
values
- are referecable values.
public void extractTriggeredEvents(java.util.List<MEventListener> res, MCard source, Test globalTest)
res
- is the list of events to fillsource
- is the card source of eventglobalTest
- the optional global test to include in the event test.public boolean isConstant()
public boolean canBePreempted()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |