1 28 29 package com.caucho.util; 30 31 import java.util.ListIterator ; 32 33 36 public class NullIterator<E> implements ListIterator <E> { 37 private static NullIterator _singleton; 38 39 public static NullIterator create() 40 { 41 if (_singleton == null) 42 _singleton = new NullIterator(); 43 44 return _singleton; 45 } 46 47 public boolean hasNext() 48 { 49 return false; 50 } 51 52 public E next() 53 { 54 return null; 55 } 56 57 public int nextIndex() 58 { 59 return -1; 60 } 61 62 public boolean hasPrevious() 63 { 64 return false; 65 } 66 67 public E previous() 68 { 69 return null; 70 } 71 72 public int previousIndex() 73 { 74 return -1; 75 } 76 77 public void add(E o) 78 { 79 throw new UnsupportedOperationException (); 80 } 81 82 public void set(E o) 83 { 84 throw new UnsupportedOperationException (); 85 } 86 87 public void remove() 88 { 89 throw new UnsupportedOperationException (); 90 } 91 } 92 | Popular Tags |