JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / jssun / util / resources / OpenListResourceBundle.js
1 Clazz.declarePackage ("jssun.util.resources");\r
2 Clazz.load (["java.util.ResourceBundle"], "jssun.util.resources.OpenListResourceBundle", ["java.lang.NullPointerException", "java.util.HashMap", "jssun.util.ResourceBundleEnumeration"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.lookup = null;\r
5 Clazz.instantialize (this, arguments);\r
6 }, jssun.util.resources, "OpenListResourceBundle", java.util.ResourceBundle);\r
7 Clazz.makeConstructor (c$, \r
8 function () {\r
9 Clazz.superConstructor (this, jssun.util.resources.OpenListResourceBundle, []);\r
10 });\r
11 Clazz.overrideMethod (c$, "handleGetObject", \r
12 function (key) {\r
13 if (key == null) {\r
14 throw  new NullPointerException ();\r
15 }this.loadLookupTablesIfNecessary ();\r
16 return this.lookup.get (key);\r
17 }, "~S");\r
18 Clazz.defineMethod (c$, "getKeys", \r
19 function () {\r
20 var parent = this.parent;\r
21 return  new jssun.util.ResourceBundleEnumeration (this.handleGetKeys (), (parent != null) ? parent.getKeys () : null);\r
22 });\r
23 Clazz.defineMethod (c$, "handleGetKeys", \r
24 function () {\r
25 this.loadLookupTablesIfNecessary ();\r
26 return this.lookup.keySet ();\r
27 });\r
28 Clazz.defineMethod (c$, "getParent", \r
29 function () {\r
30 return this.parent;\r
31 });\r
32 Clazz.defineMethod (c$, "loadLookupTablesIfNecessary", \r
33 function () {\r
34 if (this.lookup == null) {\r
35 this.loadLookup ();\r
36 }});\r
37 Clazz.defineMethod (c$, "loadLookup", \r
38  function () {\r
39 if (this.lookup != null) return;\r
40 var contents = this.getContents ();\r
41 var temp = this.createMap (contents.length);\r
42 for (var i = 0; i < contents.length; ++i) {\r
43 var key = contents[i][0];\r
44 var value = contents[i][1];\r
45 if (key == null || value == null) {\r
46 throw  new NullPointerException ();\r
47 }temp.put (key, value);\r
48 }\r
49 this.lookup = temp;\r
50 });\r
51 Clazz.defineMethod (c$, "createMap", \r
52 function (size) {\r
53 return  new java.util.HashMap (size);\r
54 }, "~N");\r
55 });\r