KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > uk > co > jezuk > mango > iterators > NullIterator


1 package uk.co.jezuk.mango.iterators;
2
3 /**
4  *
5  * @author jez@jezuk.co.uk
6  */

7 public class NullIterator implements java.util.Iterator JavaDoc
8 {
9   /** Creates a new instance of NullIterator */
10   public boolean hasNext()
11   {
12     return false;
13   } // hasNext
14

15   public Object JavaDoc next()
16   {
17     throw new UnsupportedOperationException JavaDoc("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.");
18   } // next
19

20   public void remove()
21   {
22     throw new UnsupportedOperationException JavaDoc("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.");
23   } // remove
24
} // NullIterator
25
Popular Tags