P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package foundation.json.tree;
 
import java.util.Iterator;
 
import foundation.util.MapList;
 
public class JBand implements Iterable<JBandItem> {
 
    private MapList<String, JBandItem> items;
    private int pos;
    
    public JBand() {
        items = new MapList<String, JBandItem>();
        pos = -1;
    }
    
    public void appendOne(String name, Object value) {
        JBandItem item = new JBandItem(name, value);
        items.add(name, item);
    }
    
    public void toHomePosition() {
        pos = -1;
    }
 
    public boolean hasNext() {
        if (items.isEmpty() || pos >= items.size()) {
            return false;
        }
        
        return true;
    }
 
    public boolean hasNext(String name, int level) {
        // TODO Auto-generated method stub
        return false;
    }
    
    public JBandItem next() {
        pos = pos++;
        return items.get(pos);        
    }
 
    public boolean isEmpty() {
        return items.isEmpty();
    }
 
    @Override
    public Iterator<JBandItem> iterator() {
        return items.iterator();
    }
}