96a1e5e0bd275076a5efa293b91581041723cdd4
[jalviewjs.git] / site / j2s / jssun / util / ResourceBundleEnumeration.js
1 Clazz.declarePackage ("jssun.util");\r
2 Clazz.load (["java.util.Enumeration"], "jssun.util.ResourceBundleEnumeration", ["java.util.NoSuchElementException"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.set = null;\r
5 this.iterator = null;\r
6 this.enumeration = null;\r
7 this.next = null;\r
8 Clazz.instantialize (this, arguments);\r
9 }, jssun.util, "ResourceBundleEnumeration", null, java.util.Enumeration);\r
10 Clazz.makeConstructor (c$, \r
11 function (set, enumeration) {\r
12 this.set = set;\r
13 this.iterator = set.iterator ();\r
14 this.enumeration = enumeration;\r
15 }, "java.util.Set,java.util.Enumeration");\r
16 Clazz.defineMethod (c$, "hasMoreElements", \r
17 function () {\r
18 if (this.next == null) {\r
19 if (this.iterator.hasNext ()) {\r
20 this.next = this.iterator.next ();\r
21 } else if (this.enumeration != null) {\r
22 while (this.next == null && this.enumeration.hasMoreElements ()) {\r
23 this.next = this.enumeration.nextElement ();\r
24 if (this.set.contains (this.next)) {\r
25 this.next = null;\r
26 }}\r
27 }}return this.next != null;\r
28 });\r
29 Clazz.defineMethod (c$, "nextElement", \r
30 function () {\r
31 if (this.hasMoreElements ()) {\r
32 var result = this.next;\r
33 this.next = null;\r
34 return result;\r
35 } else {\r
36 throw  new java.util.NoSuchElementException ();\r
37 }});\r
38 });\r