Search code examples
javadata-structuresjavolution

Javolution: Removing while iterating through a FastSet


In the docs it says to iterator a FastSet you can do:

 for (FastSet.Record r = set.head(), end = set.tail(); (r = r.getNext()) != end;) {
     Object value = set.valueOf(r);    
 }

Question is: How to remove while iterating?


Solution

  • The delete(r) method seems apropos, although you may also want to look at the inherited Set operations, too.