/*
 *    GeoTools - OpenSource mapping toolkit
 *    http://geotools.org
 *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
 *    
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.data.store;

import java.util.Iterator;

import org.geotools.feature.FeatureIterator;

/**
 * An {@link Iterator} which delegates to a {@link FeatureIterator}.
 * 
 * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
 * @since 2.4
 *
 */
public class FeatureIteratorIterator implements Iterator {

	/**
	 * delegate feature iterator.
	 */
	FeatureIterator delegate;
	
	/**
	 * Creates the new iterator.
	 * 
	 * @param delegate The iterator to delegate to.
	 */
	public FeatureIteratorIterator( FeatureIterator delegate ) {
		this.delegate = delegate;
	}
	
	/**
	 * Calls through to {@link FeatureIterator#hasNext()}
	 */
	public boolean hasNext() {
		return delegate.hasNext();
	}

	/**
	 * Calls through to {@link FeatureIterator#next()}
	 */
	public Object next() {
		return delegate.next();
	}

	/**
	 * @throws UnsupportedOperationException
	 */
	public void remove() {
		throw new UnsupportedOperationException("remove is not supported");
	}

	/**
	 * @return The underlying delegate.
	 */
	public FeatureIterator getDelegate() {
		return delegate;
	}
}
