X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=site%2Fj2s%2Fjssun%2Futil%2FResourceBundleEnumeration.js;fp=site%2Fj2s%2Fjssun%2Futil%2FResourceBundleEnumeration.js;h=84fc3a2bd5a2443a02fc9819adfe44f917f62177;hb=4231d40261fef32ce4570a6bbad0d35df44e8baf;hp=0000000000000000000000000000000000000000;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/site/j2s/jssun/util/ResourceBundleEnumeration.js b/site/j2s/jssun/util/ResourceBundleEnumeration.js new file mode 100644 index 0000000..84fc3a2 --- /dev/null +++ b/site/j2s/jssun/util/ResourceBundleEnumeration.js @@ -0,0 +1,38 @@ +Clazz.declarePackage ("jssun.util"); +Clazz.load (["java.util.Enumeration"], "jssun.util.ResourceBundleEnumeration", ["java.util.NoSuchElementException"], function () { +c$ = Clazz.decorateAsClass (function () { +this.set = null; +this.iterator = null; +this.enumeration = null; +this.next = null; +Clazz.instantialize (this, arguments); +}, jssun.util, "ResourceBundleEnumeration", null, java.util.Enumeration); +Clazz.makeConstructor (c$, +function (set, enumeration) { +this.set = set; +this.iterator = set.iterator (); +this.enumeration = enumeration; +}, "java.util.Set,java.util.Enumeration"); +Clazz.defineMethod (c$, "hasMoreElements", +function () { +if (this.next == null) { +if (this.iterator.hasNext ()) { +this.next = this.iterator.next (); +} else if (this.enumeration != null) { +while (this.next == null && this.enumeration.hasMoreElements ()) { +this.next = this.enumeration.nextElement (); +if (this.set.contains (this.next)) { +this.next = null; +}} +}}return this.next != null; +}); +Clazz.defineMethod (c$, "nextElement", +function () { +if (this.hasMoreElements ()) { +var result = this.next; +this.next = null; +return result; +} else { +throw new java.util.NoSuchElementException (); +}}); +});