7
|
1
|
|
2
|
|
3 function Entity (json) {
|
|
4 this.id = json.id;
|
|
5 this.oc = json.oc;
|
|
6 this.ov = json.ov;
|
|
7 this.nov = json.nov;
|
|
8 this.lw = json.lw;
|
|
9 this.node_type = json.node_type;
|
|
10
|
|
11 //attention: this array are saved as map<index, object>
|
|
12 this.atts = json.atts;
|
|
13 this.src_rels = json.src_rels;
|
|
14 this.tar_rels = json.tar_rels;
|
|
15
|
|
16 this.getAttOvByName = function(attName){
|
|
17 for(var mapKey in this.atts){
|
|
18 var name = this.atts[mapKey].name;
|
|
19 if(name == attName){
|
|
20 return this.atts[mapKey].ov;
|
|
21 }
|
|
22 }
|
|
23 }
|
|
24
|
|
25 this.toString = function() {
|
|
26 return "Entity [id="+this.id+", ov="+this.ov+"]";
|
|
27 };
|
|
28 }
|
|
29
|