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