public class EmptyIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>
Use EmptyIterator whenever you want a non-null, but empty, Iterator. It has no state so feel free to use the standardInstance() and avoid creating a new copy.
Copyright 2003-2006 Partner Software, Inc.
| Constructor and Description |
|---|
EmptyIterator()
Creates an EmptyIterator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Always returns false.
|
T |
next()
Always throws NoSuchElementException.
|
void |
remove()
Always throws UnsupportedOperationException.
|
static EmptyIterator |
standardInstance() |
public EmptyIterator()
standardInstance() instead.public static EmptyIterator standardInstance()
public boolean hasNext()
hasNext in interface java.util.Iterator<T>public T next()
next in interface java.util.Iterator<T>public void remove()
remove in interface java.util.Iterator<T>