1 28 29 package com.caucho.util; 30 31 import java.util.Enumeration ; 32 import java.util.Iterator ; 33 34 37 public class EnumIterator<T> implements Iterator <T> { 38 Enumeration <T> e; 39 40 public EnumIterator(Enumeration <T> e) 41 { 42 this.e = e; 43 } 44 45 public boolean hasNext() 46 { 47 return e != null && e.hasMoreElements(); 48 } 49 50 public T next() 51 { 52 return e != null ? e.nextElement() : null; 53 } 54 55 public void remove() 56 { 57 throw new UnsupportedOperationException (); 58 } 59 } 60 | Popular Tags |