01:package com.jamonapi.utils;
02:
03:import java.util.*;
04:
05:/** Simple Wrapper utility class that makes an Enumeration behave like an Iterator. **/
06:
07:
08:public class EnumIterator extends java.lang.Object implements java.util.Iterator {
09: Enumeration enum;
10:
11: public EnumIterator(Enumeration enum) {
12: this .enum=enum;
13: }
14:
15: public boolean hasNext() {
16: return enum.hasMoreElements();
17: }
18:
19: public Object next() {
20: return enum.nextElement();
21: }
22:
23: public void remove() {
24: throw new UnsupportedOperationException();
25: }
26:
27:}
|