1 package net.sf.jga.util; 33 34 import java.util.ListIterator ; 35 import java.util.NoSuchElementException ; 36 import java.util.Iterator ; 37 38 43 44 public class EmptyIterator<T> implements ListIterator <T>, Iterable <T> { 45 46 50 public Iterator <T> iterator() { return this; } 51 52 56 60 public boolean hasNext() { return false; } 61 62 67 public T next() { throw new NoSuchElementException (); } 68 69 73 public boolean hasPrevious() { return false; } 74 75 80 public T previous() { throw new NoSuchElementException (); } 81 82 87 public int nextIndex() { return 0; } 88 89 94 public int previousIndex() { return -1; } 95 96 99 public void remove() { throw new UnsupportedOperationException (); } 100 101 104 public void set (T arg) { throw new UnsupportedOperationException (); } 105 106 109 public void add (T arg) { throw new UnsupportedOperationException (); } 110 111 } 112 | Popular Tags |