--- /dev/null
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
+package org.ibex.util;
+
+import java.io.*;
+import java.util.*;
+
+public final class Misc {
+
+ public static class ArrayEnumeration implements Enumeration {
+ private final Object[] o;
+ private int i = 0;
+ public ArrayEnumeration(Object[] o) { this.o = o; }
+ public boolean hasMoreElements() { return o != null && i < o.length; }
+ public Object nextElement() { return hasMoreElements() ? o[i++] : null; }
+ }
+
+ public static class JoinEnumeration implements Enumeration {
+ private final Enumeration e1;
+ private final Enumeration e2;
+ public JoinEnumeration(Enumeration e1, Enumeration e2) { this.e1 = e1; this.e2 = e2; }
+ public boolean hasMoreElements() { return e1.hasMoreElements() || e2.hasMoreElements(); }
+ public Object nextElement() { return e1.hasMoreElements() ? e1.nextElement() : e2.nextElement(); }
+ }
+
+}
+