我有2个枚举,
public enum CASES { CASE1, CASE2, CASE3, CASE4 };
现在我必须实现如下的逻辑条件,
private CASES getCondition(final CASES firstLevel, final CASES secondLevel){
Switch(firstLevel) {
case CASE1:
if(secondLevel == CASES.CASE1)
return CASES.CASE1;
else if(secondLevel == CASES.CASE2)
return CASES.CASE1;
else if(secondLevel == CASES.CASE3)
return CASES.CASE4;
else
return CASE3;
case CASE2:
// Some combination logic as above;
case CASE3:
// Some combination logic as above;
case CASE4:
// Some combination logic as above;
}
}
由于这个条件太复杂了,我想用矩阵来实现。
请帮忙。