edu.neu.ccs.quick
Class IteratorFactory

java.lang.Object
  extended byedu.neu.ccs.quick.IteratorFactory

public final class IteratorFactory
extends Object

IteratorFactory encapsulates a static method to construct a Java Iterator from an Object[] array.

This class cannot be instantiated.

Since:
2.3
Version:
2.3

Constructor Summary
private IteratorFactory()
          The private constructor to prevent instantiation.
 
Method Summary
static Iterator makeIterator(Object[] array)
          Returns an Iterator that iterates over the data in the given array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorFactory

private IteratorFactory()
The private constructor to prevent instantiation.

Method Detail

makeIterator

public static Iterator makeIterator(Object[] array)

Returns an Iterator that iterates over the data in the given array. To make the iterator independent of the original array, a shallow copy of the array data is made.

Throws UnsupportedOperationException if the method remove() is called.

Parameters:
array - the array whose data will be the focus of iteration
Returns:
the iterator that iterates over the array data