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

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

Deprecated. Construct with the static factory method Iterators.array(Object[]) instead.

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

An Iterator.Array iterates over the elements of an array specified at construction time.

Implementation Note: this class does not automatically free references in the underlying array, because the array may be used elswhere. If reference freeing is critical here, a call to remove() after ever next() will free the references in the array.

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

Constructor Summary
Iterators.Array(E[] members)
          Deprecated. Use the static factory method Iterators.array(Object[]) instead.
 
Method Summary
 boolean hasNext()
          Deprecated. Returns true if this iterator has more elements.
 E next()
          Deprecated. Returns the next element in the array.
 void remove()
          Deprecated. Sets position in underlying array corresponding to the most recently returned token to null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterators.Array

@Deprecated
public Iterators.Array(E[] members)
Deprecated. Use the static factory method Iterators.array(Object[]) instead.

Construct an array iterator from the specified array.

Parameters:
members - Array basis of the constructed iterator.
Method Detail

hasNext

public boolean hasNext()
Deprecated. 
Returns true if this iterator has more elements.

Specified by:
hasNext in interface Iterator<E>
Returns:
true if this iterator has more elements.

next

public E next()
Deprecated. 
Returns the next element in the array.

Specified by:
next in interface Iterator<E>
Returns:
Next element in the array.
Throws:
NoSuchElementException - If there are no more elements left in the array to return.

remove

public void remove()
Deprecated. 
Sets position in underlying array corresponding to the most recently returned token to null.

Specified by:
remove in interface Iterator<E>
Throws:
IllegalStateException - If the next method has not been called, or the remove method has already been called after the last call to the next method.