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

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

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

An Iterators.Pair provides an iterator over a sequence of exactly two elements.

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

Constructor Summary
Iterators.Pair(E member1, E member2)
          Construct a pair iterator based on the containing pair set.
 
Method Summary
 boolean hasNext()
          Returns true if there are more elements left to return.
 E next()
          Returns the next object in this pair iterator, or throws an exception if there aren't any more.
 void remove()
          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.Pair

public Iterators.Pair(E member1,
                      E member2)
Construct a pair iterator based on the containing pair set.

Method Detail

hasNext

public boolean hasNext()
Returns true if there are more elements left to return.

Specified by:
hasNext in interface Iterator<E>
Returns:
true if there are more elements left to return.

next

public E next()
Returns the next object in this pair iterator, or throws an exception if there aren't any more.

Specified by:
next in interface Iterator<E>
Returns:
Next object in this pair iterator.

remove

public void remove()
Throws an unsupported operation exception.

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