1 16 package org.apache.myfaces.util; 17 18 import java.util.Iterator ; 19 import java.util.NoSuchElementException ; 20 21 22 38 public final class NullIterator implements Iterator  39 { 40 42 private static final NullIterator INSTANCE = new NullIterator(); 43 44 46 public static final Iterator instance() 47 { 48 return INSTANCE; 49 } 50 51 public boolean hasNext() 52 { 53 return false; 54 } 55 56 public Object next() 57 { 58 throw new NoSuchElementException (); 59 } 60 61 public void remove() 62 { 63 throw new UnsupportedOperationException (this.getClass().getName() + " UnsupportedOperationException"); 64 } 65 } 66 | Popular Tags |