list <对象>将不满足条件的对象移除,采用迭代器
//将不需要的对象去掉
Iterator<TableBean> it = list.iterator();
int index = 0;
while (it.hasNext())
{
TableBean next = it.next();
if (next.getFIELDENNAME().equals("ID")) //needDelete返回boolean。决定是否要删除
{
it.remove();
}
index ++;
}
//将不需要的对象去掉
Iterator<TableBean> it = list.iterator();
int index = 0;
while (it.hasNext())
{
TableBean next = it.next();
if (next.getFIELDENNAME().equals("ID")) //needDelete返回boolean。决定是否要删除
{
it.remove();
}
index ++;
}