All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aksw.commons.collections.ChainIterator Maven / Gradle / Ivy

There is a newer version: 0.9.9
Show newest version
package org.aksw.commons.collections;


import java.util.Collection;
import java.util.Iterator;

/**
 * Created by Claus Stadler
 * Date: Oct 7, 2010
 * Time: 5:00:39 PM
 */

public class ChainIterator
	extends PrefetchIterator
{
	private Iterator>	metaIterator;

	public ChainIterator(Iterator> metaIterator)
	{
		this.metaIterator = metaIterator;
	}

	public ChainIterator(Collection> metaContainer)
	{
		this.metaIterator = metaContainer.iterator();
	}

	@Override
	protected Iterator prefetch()
	{
		if (!metaIterator.hasNext())
			return null;

		return metaIterator.next().iterator();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy