0
它是安全的刪除和添加元素ConcurrentSkipListSet
在遍歷它:刪除和添加元素ConcurrentSkipListSet而迭代
ConcurrentSkipListSet<Element> set = new ConcurrentSkipListSet<Element>(myComparator);
for(Element e : set)
{
if(condition)
{
set.remove(e);
set.add(anotherE);
}
}
其中e
和anotherE
是提供比較平等的。