JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / jalview / datamodel / DBRefEntry.js
1 Clazz.declarePackage ("jalview.datamodel");\r
2 Clazz.load (null, "jalview.datamodel.DBRefEntry", ["jalview.datamodel.Mapping"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.source = "";\r
5 this.version = "";\r
6 this.accessionId = "";\r
7 this.map = null;\r
8 Clazz.instantialize (this, arguments);\r
9 }, jalview.datamodel, "DBRefEntry");\r
10 Clazz.makeConstructor (c$, \r
11 function () {\r
12 });\r
13 Clazz.makeConstructor (c$, \r
14 function (source, version, accessionId) {\r
15 this.construct (source, version, accessionId, null);\r
16 }, "~S,~S,~S");\r
17 Clazz.makeConstructor (c$, \r
18 function (source, version, accessionId, map) {\r
19 this.source = source.toUpperCase ();\r
20 this.version = version;\r
21 this.accessionId = accessionId;\r
22 this.map = map;\r
23 }, "~S,~S,~S,jalview.datamodel.Mapping");\r
24 Clazz.makeConstructor (c$, \r
25 function (entry) {\r
26 this.construct ((entry.source == null ? "" :  String.instantialize (entry.source)), (entry.version == null ? "" :  String.instantialize (entry.version)), (entry.accessionId == null ? "" :  String.instantialize (entry.accessionId)), (entry.map == null ? null :  new jalview.datamodel.Mapping (entry.map)));\r
27 }, "jalview.datamodel.DBRefEntry");\r
28 Clazz.overrideMethod (c$, "equals", \r
29 function (o) {\r
30 if (o == null || !(Clazz.instanceOf (o, jalview.datamodel.DBRefEntry))) {\r
31 return false;\r
32 }var entry = o;\r
33 if (entry === this) {\r
34 return true;\r
35 }if (this.equalRef (entry) && ((this.map == null && entry.map == null) || (this.map != null && entry.map != null && this.map.equals (entry.map)))) {\r
36 return true;\r
37 }return false;\r
38 }, "~O");\r
39 Clazz.defineMethod (c$, "equalRef", \r
40 function (entry) {\r
41 if (entry == null) {\r
42 return false;\r
43 }if (entry === this) {\r
44 return true;\r
45 }if ((this.source != null && entry.source != null && this.source.equalsIgnoreCase (entry.source)) && (this.accessionId != null && entry.accessionId != null && this.accessionId.equalsIgnoreCase (entry.accessionId)) && (this.version != null && entry.version != null && this.version.equalsIgnoreCase (entry.version))) {\r
46 return true;\r
47 }return false;\r
48 }, "jalview.datamodel.DBRefEntry");\r
49 Clazz.defineMethod (c$, "getSource", \r
50 function () {\r
51 return this.source;\r
52 });\r
53 Clazz.defineMethod (c$, "getVersion", \r
54 function () {\r
55 return this.version;\r
56 });\r
57 Clazz.defineMethod (c$, "getAccessionId", \r
58 function () {\r
59 return this.accessionId;\r
60 });\r
61 Clazz.defineMethod (c$, "setAccessionId", \r
62 function (accessionId) {\r
63 this.accessionId = accessionId;\r
64 }, "~S");\r
65 Clazz.defineMethod (c$, "setSource", \r
66 function (source) {\r
67 this.source = source;\r
68 }, "~S");\r
69 Clazz.defineMethod (c$, "setVersion", \r
70 function (version) {\r
71 this.version = version;\r
72 }, "~S");\r
73 Clazz.defineMethod (c$, "getMap", \r
74 function () {\r
75 return this.map;\r
76 });\r
77 Clazz.defineMethod (c$, "setMap", \r
78 function (map) {\r
79 this.map = map;\r
80 }, "jalview.datamodel.Mapping");\r
81 Clazz.defineMethod (c$, "hasMap", \r
82 function () {\r
83 return this.map != null;\r
84 });\r
85 Clazz.defineMethod (c$, "getSrcAccString", \r
86 function () {\r
87 return ((this.source != null) ? this.source : "") + ":" + ((this.accessionId != null) ? this.accessionId : "");\r
88 });\r
89 Clazz.overrideMethod (c$, "toString", \r
90 function () {\r
91 return this.getSrcAccString ();\r
92 });\r
93 });\r