1 5 package com.opensymphony.webwork.util; 6 7 import java.util.Enumeration ; 8 import java.util.Iterator ; 9 10 11 17 public abstract class IteratorFilterSupport { 18 20 protected Object getIterator(Object source) { 22 return MakeIterator.convert(source); 23 } 24 25 27 public class EnumerationIterator implements Iterator { 29 Enumeration enumeration; 30 31 public EnumerationIterator(Enumeration aEnum) { 32 enumeration = aEnum; 33 } 34 35 public boolean hasNext() { 36 return enumeration.hasMoreElements(); 37 } 38 39 public Object next() { 40 return enumeration.nextElement(); 41 } 42 43 public void remove() { 44 throw new UnsupportedOperationException ("Remove is not supported in IteratorFilterSupport."); 45 } 46 } 47 } 48 | Popular Tags |