TangCheng
2025-04-20 c9a49dd6c5f6bc1115c2a12f3097925a53d5bf7e
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
package com.smtaiserver.smtaiserver.gismap;
 
import java.util.HashMap;
import java.util.Map;
 
import com.smtaiserver.smtaiserver.database.SMTDatabase.DBRecord;
 
public class SMTMapOtypeDef
{
    private String                _OTYPE;
    private String                _title;
    private Map<String, SMTMapVPropDef>    _mapId2VPropDef = new HashMap<>();
    
    public SMTMapOtypeDef(DBRecord rec) throws Exception
    {
        _OTYPE = rec.getString("otype");
        _title = rec.getString("title");
    }
    
    public String getOTYPE()
    {
        return _OTYPE;
    }
    
    public String getTitle()
    {
        return _title;
    }
    
    public void addVPropDef(DBRecord rec) throws Exception
    {
        SMTMapVPropDef vpropDef = new SMTMapVPropDef(this, rec);
        _mapId2VPropDef.put(vpropDef.getVPROP(), vpropDef);
    }
    
    public Map<String, SMTMapVPropDef> getVPropDefMap()
    {
        return _mapId2VPropDef;
    }
    
    public SMTMapVPropDef getVPropDef(String VPROP) throws Exception
    {
        SMTMapVPropDef VPropDef = _mapId2VPropDef.get(VPROP);
        if(VPropDef == null)
            throw new Exception("can't get VPROP : " + _OTYPE + "." + VPROP);
        return VPropDef;
    }
}