01: package uk.co.jezuk.mango.iterators;
02:
03: /**
04: *
05: * @author jez@jezuk.co.uk
06: */
07: public class NullIterator implements java.util.Iterator {
08: /** Creates a new instance of NullIterator */
09: public boolean hasNext() {
10: return false;
11: } // hasNext
12:
13: public Object next() {
14: throw new java.util.NoSuchElementException(
15: "uk.co.jezuk.mango.NullIterator does not support the next method. In fact it's probably a logic error that you called it at all.");
16: } // next
17:
18: public void remove() {
19: throw new UnsupportedOperationException(
20: "uk.co.jezuk.mango.NullIterator does not support the remove method. In fact it's probably a logic error that you called it at all.");
21: } // remove
22: } // NullIterator
|