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
package foundation.state;
 
import java.util.Iterator;
import java.util.List;
 
import foundation.util.MapList;
import foundation.util.Util;
 
public class StatePointBucket implements Iterable<StatePoint> {
 
    private MapList<String, StatePoint> points;
    
    public StatePointBucket() {
        points = new MapList<String, StatePoint>();
    }
    
    public void loadOne(StatePoint point) {
        points.add(point.getKey(), point);
    }
 
    public StatePoint get(String key) {
        return points.get(key);
    }
 
    public StatePoint getPointByToState(String another) {
        if (Util.isEmpty(another)) {
            return null;
        }
        
        for (StatePoint point: points) {
            String toCode = point.getToCode();
            
            if (another.equals(toCode)) {
                return point;
            }
        }
        
        return null;
    }
 
    public List<StatePoint> getList() {
        return points.getItemList();
    }
 
    @Override
    public Iterator<StatePoint> iterator() {
        return points.iterator();
    }
 
}