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