Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return new Iterator<V>()
- {
- int cur = -1;
- V next = computeNext();
- @Override
- public boolean hasNext()
- {
- return next != null;
- }
- private V computeNext() {
- V ret = null;
- do {
- cur = availabilityMap.nextSetBit(cur + 1);
- ret = ids.get(cur);
- } while (ret == null && cur != -1);
- return ret;
- }
- @Override
- public V next()
- {
- V ret = next;
- next = computeNext();
- return ret;
- }
- //TODO add remove support?
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement