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