com.aliasi.util
Class Iterators.Empty<E>

java.lang.Object
  extended by com.aliasi.util.Iterators.Empty<E>
All Implemented Interfaces:
Iterator<E>
Enclosing class:
Iterators

public static class Iterators.Empty<E>
extends Object
implements Iterator<E>

An Iterator.Empty is an iterator with no objects. The method hasNext() always returns false, while the methods next() and remove() always throw exceptions.

Since:
LingPipe3.0
Version:
3.0
Author:
Bob Carpenter

Constructor Summary
Iterators.Empty()
           
 
Method Summary
 boolean hasNext()
          Always returns false.
 E next()
          Calling this method throws a no-such-element exception.
 void remove()
          Calling this method throws an illegal state exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterators.Empty

public Iterators.Empty()
Method Detail

hasNext

public boolean hasNext()
Always returns false.

Specified by:
hasNext in interface Iterator<E>
Returns:
false.

next

public E next()
Calling this method throws a no-such-element exception.

Specified by:
next in interface Iterator<E>
Returns:
Always throws an exception.
Throws:
NoSuchElementException - Always.

remove

public void remove()
Calling this method throws an illegal state exception.

Specified by:
remove in interface Iterator<E>
Throws:
IllegalStateException - Always.