JAL-1807 test
[jalviewjs.git] / bin / jalview / datamodel / SequenceFeature.js
1 Clazz.declarePackage ("jalview.datamodel");
2 Clazz.load (null, "jalview.datamodel.SequenceFeature", ["java.util.Hashtable", "$.Vector"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.begin = 0;
5 this.end = 0;
6 this.score = 0;
7 this.type = null;
8 this.description = null;
9 this.otherDetails = null;
10 this.links = null;
11 this.featureGroup = null;
12 Clazz.instantialize (this, arguments);
13 }, jalview.datamodel, "SequenceFeature");
14 Clazz.makeConstructor (c$, 
15 function () {
16 });
17 Clazz.makeConstructor (c$, 
18 function (cpy) {
19 if (cpy != null) {
20 this.begin = cpy.begin;
21 this.end = cpy.end;
22 this.score = cpy.score;
23 if (cpy.type != null) {
24 this.type =  String.instantialize (cpy.type);
25 }if (cpy.description != null) {
26 this.description =  String.instantialize (cpy.description);
27 }if (cpy.featureGroup != null) {
28 this.featureGroup =  String.instantialize (cpy.featureGroup);
29 }if (cpy.otherDetails != null) {
30 try {
31 this.otherDetails = cpy.otherDetails.clone ();
32 } catch (e) {
33 if (Clazz.exceptionOf (e, Exception)) {
34 } else {
35 throw e;
36 }
37 }
38 }if (cpy.links != null && cpy.links.size () > 0) {
39 this.links =  new java.util.Vector ();
40 for (var i = 0, iSize = cpy.links.size (); i < iSize; i++) {
41 this.links.addElement (cpy.links.elementAt (i));
42 }
43 }}}, "jalview.datamodel.SequenceFeature");
44 Clazz.makeConstructor (c$, 
45 function (type, desc, status, begin, end, featureGroup) {
46 this.type = type;
47 this.description = desc;
48 this.setValue ("status", status);
49 this.begin = begin;
50 this.end = end;
51 this.featureGroup = featureGroup;
52 }, "~S,~S,~S,~N,~N,~S");
53 Clazz.makeConstructor (c$, 
54 function (type, desc, begin, end, score, featureGroup) {
55 this.type = type;
56 this.description = desc;
57 this.begin = begin;
58 this.end = end;
59 this.score = score;
60 this.featureGroup = featureGroup;
61 }, "~S,~S,~N,~N,~N,~S");
62 Clazz.defineMethod (c$, "equals", 
63 function (sf) {
64 if (this.begin != sf.begin || this.end != sf.end || this.score != sf.score) {
65 return false;
66 }if (!(this.type + this.description + this.featureGroup).equals (sf.type + sf.description + sf.featureGroup)) {
67 return false;
68 }return true;
69 }, "jalview.datamodel.SequenceFeature");
70 Clazz.defineMethod (c$, "getBegin", 
71 function () {
72 return this.begin;
73 });
74 Clazz.defineMethod (c$, "setBegin", 
75 function (start) {
76 this.begin = start;
77 }, "~N");
78 Clazz.defineMethod (c$, "getEnd", 
79 function () {
80 return this.end;
81 });
82 Clazz.defineMethod (c$, "setEnd", 
83 function (end) {
84 this.end = end;
85 }, "~N");
86 Clazz.defineMethod (c$, "getType", 
87 function () {
88 return this.type;
89 });
90 Clazz.defineMethod (c$, "setType", 
91 function (type) {
92 this.type = type;
93 }, "~S");
94 Clazz.defineMethod (c$, "getDescription", 
95 function () {
96 return this.description;
97 });
98 Clazz.defineMethod (c$, "setDescription", 
99 function (desc) {
100 this.description = desc;
101 }, "~S");
102 Clazz.defineMethod (c$, "getFeatureGroup", 
103 function () {
104 return this.featureGroup;
105 });
106 Clazz.defineMethod (c$, "setFeatureGroup", 
107 function (featureGroup) {
108 this.featureGroup = featureGroup;
109 }, "~S");
110 Clazz.defineMethod (c$, "addLink", 
111 function (labelLink) {
112 if (this.links == null) {
113 this.links =  new java.util.Vector ();
114 }this.links.insertElementAt (labelLink, 0);
115 }, "~S");
116 Clazz.defineMethod (c$, "getScore", 
117 function () {
118 return this.score;
119 });
120 Clazz.defineMethod (c$, "setScore", 
121 function (value) {
122 this.score = value;
123 }, "~N");
124 Clazz.defineMethod (c$, "getValue", 
125 function (key) {
126 if (this.otherDetails == null) {
127 return null;
128 } else {
129 return this.otherDetails.get (key);
130 }}, "~S");
131 Clazz.defineMethod (c$, "setValue", 
132 function (key, value) {
133 if (value != null) {
134 if (this.otherDetails == null) {
135 this.otherDetails =  new java.util.Hashtable ();
136 }this.otherDetails.put (key, value);
137 }}, "~S,~O");
138 Clazz.defineMethod (c$, "setStatus", 
139 function (status) {
140 this.setValue ("status", status);
141 }, "~S");
142 Clazz.defineMethod (c$, "getStatus", 
143 function () {
144 if (this.otherDetails != null) {
145 var stat = this.otherDetails.get ("status");
146 if (stat != null) {
147 return  String.instantialize (stat);
148 }}return null;
149 });
150 Clazz.defineMethod (c$, "setPosition", 
151 function (pos) {
152 this.begin = pos;
153 this.end = pos;
154 }, "~N");
155 Clazz.defineMethod (c$, "getPosition", 
156 function () {
157 return this.begin;
158 });
159 Clazz.defineMethod (c$, "getStrand", 
160 function () {
161 var str;
162 if (this.otherDetails == null || (str = this.otherDetails.get ("STRAND").toString ()) == null) {
163 return 0;
164 }if (str.equals ("-")) {
165 return -1;
166 }if (str.equals ("+")) {
167 return 1;
168 }return 0;
169 });
170 });