View Javadoc

1   package com.ochafik.util;
2   import java.util.Enumeration;
3   import java.util.Iterator;
4   @SuppressWarnings("unchecked")
5   public class IteratorEnumeration implements Enumeration {
6   	Iterator it;
7   	public IteratorEnumeration(Iterator it) {
8   		this.it=it;
9   	}
10  	public boolean hasMoreElements() {
11  		return it.hasNext();
12  	}
13  	public Object nextElement() {
14  		return it.next();
15  	}
16  }