1 16 package org.apache.commons.collections.iterators; 17 18 import java.util.Enumeration ; 19 import java.util.Iterator ; 20 21 30 public class IteratorEnumeration implements Enumeration { 31 32 33 private Iterator iterator; 34 35 40 public IteratorEnumeration() { 41 super(); 42 } 43 44 50 public IteratorEnumeration( Iterator iterator ) { 51 super(); 52 this.iterator = iterator; 53 } 54 55 58 63 public boolean hasMoreElements() { 64 return iterator.hasNext(); 65 } 66 67 74 public Object nextElement() { 75 return iterator.next(); 76 } 77 78 81 86 public Iterator getIterator() { 87 return iterator; 88 } 89 90 95 public void setIterator( Iterator iterator ) { 96 this.iterator = iterator; 97 } 98 99 } 100 | Popular Tags |