Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / net / Parts.js
1 Clazz.declarePackage ("java.net");
2 c$ = Clazz.decorateAsClass (function () {
3 this.path = null;
4 this.query = null;
5 this.ref = null;
6 Clazz.instantialize (this, arguments);
7 }, java.net, "Parts");
8 Clazz.makeConstructor (c$, 
9 function (file) {
10 var ind = file.indexOf ('#');
11 this.ref = ind < 0 ? null : file.substring (ind + 1);
12 file = ind < 0 ? file : file.substring (0, ind);
13 var q = file.lastIndexOf ('?');
14 if (q != -1) {
15 this.query = file.substring (q + 1);
16 this.path = file.substring (0, q);
17 } else {
18 this.path = file;
19 }}, "~S");
20 Clazz.defineMethod (c$, "getPath", 
21 function () {
22 return this.path;
23 });
24 Clazz.defineMethod (c$, "getQuery", 
25 function () {
26 return this.query;
27 });
28 Clazz.defineMethod (c$, "getRef", 
29 function () {
30 return this.ref;
31 });