1 16 package org.apache.commons.collections.iterators; 17 18 import java.util.Iterator ; 19 20 31 public class AbstractIteratorDecorator implements Iterator { 32 33 34 protected final Iterator iterator; 35 36 43 public AbstractIteratorDecorator(Iterator iterator) { 44 super(); 45 if (iterator == null) { 46 throw new IllegalArgumentException ("Iterator must not be null"); 47 } 48 this.iterator = iterator; 49 } 50 51 56 protected Iterator getIterator() { 57 return iterator; 58 } 59 60 public boolean hasNext() { 62 return iterator.hasNext(); 63 } 64 65 public Object next() { 66 return iterator.next(); 67 } 68 69 public void remove() { 70 iterator.remove(); 71 } 72 73 } 74 | Popular Tags |