這裏是代碼的和平,這我期待使其更有效率 我看到很多如果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