com.claritysys.util
Class EmptyIterator

java.lang.Object
  extended by com.claritysys.util.EmptyIterator
All Implemented Interfaces:
java.util.Iterator

public final class EmptyIterator
extends java.lang.Object
implements java.util.Iterator

EmptyIterator provides a memory-efficient way for methods to return an Iterator which has no elements.

To acquire an instance, invoke iterator.

Version:
$Revision: 2348 $
See Also:
Iterator

Method Summary
 boolean hasNext()
          Return false.
static java.util.Iterator iterator()
          Return the instance.
 java.lang.Object next()
          Throw an exception.
 void remove()
          Throw an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

iterator

public static java.util.Iterator iterator()
Return the instance.

Returns:
the single instance.

hasNext

public boolean hasNext()
Return false.

Specified by:
hasNext in interface java.util.Iterator
Returns:
false, no matter what.

next

public java.lang.Object next()
Throw an exception.

Specified by:
next in interface java.util.Iterator

remove

public void remove()
Throw an exception.

Specified by:
remove in interface java.util.Iterator


Copyright ? 2002 Clarity Systems Group, LLC. All Rights Reserved.