a7fb6b945a3d3e2d0ede757112d416688c243e24
[jalviewjs.git] / site / j2s / java / util / ListResourceBundle.js
1 Clazz.declarePackage ("java.util");
2 Clazz.load (["java.util.ResourceBundle"], "java.util.ListResourceBundle", ["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 }, java.util, "ListResourceBundle", java.util.ResourceBundle);
7 Clazz.makeConstructor (c$, 
8 function () {
9 Clazz.superConstructor (this, java.util.ListResourceBundle, []);
10 });
11 Clazz.overrideMethod (c$, "handleGetObject", 
12 function (key) {
13 if (this.lookup == null) {
14 this.loadLookup ();
15 }if (key == null) {
16 throw  new NullPointerException ();
17 }return this.lookup.get (key);
18 }, "~S");
19 Clazz.defineMethod (c$, "getKeys", 
20 function () {
21 if (this.lookup == null) {
22 this.loadLookup ();
23 }var parent = this.parent;
24 return  new jssun.util.ResourceBundleEnumeration (this.lookup.keySet (), (parent != null) ? parent.getKeys () : null);
25 });
26 Clazz.overrideMethod (c$, "handleKeySet", 
27 function () {
28 if (this.lookup == null) {
29 this.loadLookup ();
30 }return this.lookup.keySet ();
31 });
32 Clazz.defineMethod (c$, "loadLookup", 
33  function () {
34 if (this.lookup != null) return;
35 var contents = this.getContents ();
36 var temp =  new java.util.HashMap (contents.length);
37 for (var i = 0; i < contents.length; ++i) {
38 var key = contents[i][0];
39 var value = contents[i][1];
40 if (key == null || value == null) {
41 throw  new NullPointerException ();
42 }temp.put (key, value);
43 }
44 this.lookup = temp;
45 });
46 });