这里是代码的和平,这我期待使其更有效率 我看到很多如果else语句,代码清理了,如果else语句
任何一个可以帮助我,使之简单和减少代码
if(mmPageCounter.equalsIgnoreCase("trueNotFull")){
if(whatPageNext.equalsIgnoreCase("first"))
accountListSize = 5;
else
accountListSize = acctIdList.size();
}else if(mmPageCounter.equalsIgnoreCase("true")){
if(whatPageNext.equalsIgnoreCase("first"))
accountListSize = 5;
else
accountListSize = 10;
}else if(mmPageCounter.equalsIgnoreCase("false")){
if(whatPageNext.equalsIgnoreCase("alwaysFirst"))
accountListSize = acctIdList.size();
}
线的数目在基于mmPageCounter上面的代码基于我的 索引的For循环设置要么全capactiy,或与实际值的值
全容量意味着,for循环将迭代只有10个项目
PS:我已经得到了代码工作,并以其优良的,但我的微调
只想找如果任何一个人有任何罚款调音提示请分享链接。
使用枚举和switchcase – 2011-05-25 08:27:36
可能会使用switch语句吗? – Treemonkey 2011-05-25 08:28:35