|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--jpel.language.AbstractExpression
|
+--jpel.language.ExpressionSwitch
Rerpesenta o operador de múltipla escolha.
Syntax:
| case condition1 = expression1;
| case condition2 = expression2;
...
| case conditionN = expressionN;
| otherwise = defaultExpression;
Exemplo:
fat n =
| n == 1 = 0
| otherwise = n * fat (n - 1)
| Constructor Summary | |
ExpressionSwitch(jpel.language.ExpressionList conditions,
jpel.language.ExpressionList expressions,
jpel.language.Expression otherwise)
|
|
| Method Summary | |
boolean |
equivalent(jpel.language.Expression expression)
Indica se uma expressão pode ser considerada equivalente à outra. |
jpel.language.Expression |
eval(jpel.language.Environment environment)
Executa uma expressão de acordo com o ambiente definido. |
void |
freeVariable(jpel.language.ExpressionList list)
Guarda as variáveis livres da expressão em uma lista. |
jpel.language.ExpressionList |
getConditions()
|
jpel.language.ExpressionList |
getExpressions()
|
jpel.language.Expression |
getOtherwise()
|
jpel.language.Expression |
rebuild(jpel.language.MapReplace map)
Permite que sub-expressões sejam substibuídas por outras, de acordo com o mapeamento dado. |
void |
setConditions(jpel.language.ExpressionList newConditions)
|
void |
setExpressions(jpel.language.ExpressionList newExpressions)
|
void |
setOtherwise(jpel.language.Expression newOtherwise)
|
java.lang.String |
toString()
|
| Methods inherited from class jpel.language.AbstractExpression |
createClone, getData, getData, getSource, getType, setData, setSource, setType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ExpressionSwitch(jpel.language.ExpressionList conditions,
jpel.language.ExpressionList expressions,
jpel.language.Expression otherwise)
| Method Detail |
public jpel.language.ExpressionList getConditions()
public void setConditions(jpel.language.ExpressionList newConditions)
public void setExpressions(jpel.language.ExpressionList newExpressions)
public jpel.language.ExpressionList getExpressions()
public void setOtherwise(jpel.language.Expression newOtherwise)
public jpel.language.Expression getOtherwise()
public void freeVariable(jpel.language.ExpressionList list)
Expression
list - A lista onde as variáveis livres vão ser inseridas.public jpel.language.Expression rebuild(jpel.language.MapReplace map)
Expression
map - O mapeamento que guarda as substituições.
public jpel.language.Expression eval(jpel.language.Environment environment)
throws ExecutionException
Expression
environment - Ambiente no qual a expressão deve ser executada.
ExecutionException - Quando os tipos necessários para a correta
avaliação da expressão não são respeitados.public boolean equivalent(jpel.language.Expression expression)
Expression
equivalent in interface Expressionequivalent in class AbstractExpressionexpression - Expressão ao qual se deseja verificar a equivalência.
public java.lang.String toString()
toString in class AbstractExpression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||