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

java.lang.Object
  extended by com.aliasi.util.Iterators.Singleton<E>
Type Parameters:
E - the type of objects returned by the iterator
All Implemented Interfaces:
Iterator<E>
Enclosing class:
Iterators

Deprecated. Use the static factory method Iterators.singleton(Object) instead.

@Deprecated
public static class Iterators.Singleton<E>
extends Object
implements Iterator<E>

An Iterator.Singleton is an iterator over a singleton object.

Since:
LingPipe2.0
Version:
3.8
Author:
Bob Carpenter

Constructor Summary
Iterators.Singleton(E member)
          Deprecated. Use the static factory method Iterators.singleton(Object) instead.
 
Method Summary
 boolean hasNext()
          Deprecated. Returns true if the single member has not already been returned.
 E next()
          Deprecated. Returns the singleton member if it has not yet been returned, otherwise throw an exception.
 void remove()
          Deprecated. Throws an unsupported operation exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterators.Singleton

@Deprecated
public Iterators.Singleton(E member)
Deprecated. Use the static factory method Iterators.singleton(Object) instead.

Construct a singleton iterator that returns the specified object.

Parameters:
member - Single member over which to iterate.
Method Detail

hasNext

public boolean hasNext()
Deprecated. 
Returns true if the single member has not already been returned.

Specified by:
hasNext in interface Iterator<E>
Returns:
true if the single member has not already been returned.

next

public E next()
Deprecated. 
Returns the singleton member if it has not yet been returned, otherwise throw an exception.

Specified by:
next in interface Iterator<E>
Returns:
Singleton member if it has not yet been returned.
Throws:
NoSuchElementException - If the singleton member has already been returned and no elements remain.

remove

public void remove()
Deprecated. 
Throws an unsupported operation exception.

Specified by:
remove in interface Iterator<E>
Throws:
UnsupportedOperationException - Whenver called.