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