1 42 43 package org.jfree.util; 44 45 import java.util.Iterator ; 46 47 52 public class ReadOnlyIterator implements Iterator { 53 54 55 private Iterator base; 56 57 62 public ReadOnlyIterator(final Iterator it) { 63 if (it == null) { 64 throw new NullPointerException ("Base iterator is null."); 65 } 66 this.base = it; 67 } 68 69 76 public boolean hasNext() { 77 return this.base.hasNext(); 78 } 79 80 86 public Object next() { 87 return this.base.next(); 88 } 89 90 93 public void remove() { 94 throw new UnsupportedOperationException (); 95 } 96 } 97 | Popular Tags |