X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=site%2Fj2s%2Fjssun%2Futil%2Fresources%2FOpenListResourceBundle.js;fp=site%2Fj2s%2Fjssun%2Futil%2Fresources%2FOpenListResourceBundle.js;h=e25f673ee59106b804bbe789f4545b3657119f82;hb=4231d40261fef32ce4570a6bbad0d35df44e8baf;hp=0000000000000000000000000000000000000000;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/site/j2s/jssun/util/resources/OpenListResourceBundle.js b/site/j2s/jssun/util/resources/OpenListResourceBundle.js new file mode 100644 index 0000000..e25f673 --- /dev/null +++ b/site/j2s/jssun/util/resources/OpenListResourceBundle.js @@ -0,0 +1,55 @@ +Clazz.declarePackage ("jssun.util.resources"); +Clazz.load (["java.util.ResourceBundle"], "jssun.util.resources.OpenListResourceBundle", ["java.lang.NullPointerException", "java.util.HashMap", "jssun.util.ResourceBundleEnumeration"], function () { +c$ = Clazz.decorateAsClass (function () { +this.lookup = null; +Clazz.instantialize (this, arguments); +}, jssun.util.resources, "OpenListResourceBundle", java.util.ResourceBundle); +Clazz.makeConstructor (c$, +function () { +Clazz.superConstructor (this, jssun.util.resources.OpenListResourceBundle, []); +}); +Clazz.overrideMethod (c$, "handleGetObject", +function (key) { +if (key == null) { +throw new NullPointerException (); +}this.loadLookupTablesIfNecessary (); +return this.lookup.get (key); +}, "~S"); +Clazz.defineMethod (c$, "getKeys", +function () { +var parent = this.parent; +return new jssun.util.ResourceBundleEnumeration (this.handleGetKeys (), (parent != null) ? parent.getKeys () : null); +}); +Clazz.defineMethod (c$, "handleGetKeys", +function () { +this.loadLookupTablesIfNecessary (); +return this.lookup.keySet (); +}); +Clazz.defineMethod (c$, "getParent", +function () { +return this.parent; +}); +Clazz.defineMethod (c$, "loadLookupTablesIfNecessary", +function () { +if (this.lookup == null) { +this.loadLookup (); +}}); +Clazz.defineMethod (c$, "loadLookup", + function () { +if (this.lookup != null) return; +var contents = this.getContents (); +var temp = this.createMap (contents.length); +for (var i = 0; i < contents.length; ++i) { +var key = contents[i][0]; +var value = contents[i][1]; +if (key == null || value == null) { +throw new NullPointerException (); +}temp.put (key, value); +} +this.lookup = temp; +}); +Clazz.defineMethod (c$, "createMap", +function (size) { +return new java.util.HashMap (size); +}, "~N"); +});