991 |
|
return null; |
992 |
|
} |
993 |
|
|
994 |
– |
static class EmptyIterator<E> implements Iterator<E> { |
995 |
– |
public boolean hasNext() { |
996 |
– |
return false; |
997 |
– |
} |
998 |
– |
public E next() { |
999 |
– |
throw new NoSuchElementException(); |
1000 |
– |
} |
1001 |
– |
public void remove() { |
1002 |
– |
throw new IllegalStateException(); |
1003 |
– |
} |
1004 |
– |
} |
1005 |
– |
|
994 |
|
/** |
995 |
|
* Returns an empty iterator in which <tt>hasNext</tt> always returns |
996 |
|
* <tt>false</tt>. |
998 |
|
* @return an empty iterator |
999 |
|
*/ |
1000 |
|
public Iterator<E> iterator() { |
1001 |
< |
return new EmptyIterator<E>(); |
1001 |
> |
return Collections.emptyIterator(); |
1002 |
|
} |
1003 |
|
|
1004 |
|
/** |