try to fix some minor dropdown bugs
[potlatch2.git] / org / idmedia / as3commons / util / EntrySetIterator.as
1 package org.idmedia.as3commons.util
2 {
3         import org.idmedia.as3commons.lang.*;
4         
5         internal class EntrySetIterator implements Iterator {
6           
7           private var cursor:int = 0;
8           private var current:Entry = null;
9           private var s:EntrySet = null;
10           
11           function EntrySetIterator(s:EntrySet = null) {
12             this.s = s;
13           }
14           
15           public function hasNext():Boolean {
16             return (cursor < s.size());
17           }
18           
19           public function next():* {
20             var h:int = s.size();
21             current = s.get(cursor++) as Entry;
22             if(current == null) {
23               throw new NoSuchElementException();       
24             }
25             return current;
26           }
27           
28           public function remove():void {
29             if(current == null) {
30               throw new IllegalStateException();        
31             }
32             var key:* = current.getKey();
33             current = null;
34             s.removeEntryForKey(key);
35           }
36         }
37 }