org.aksw.commons.collections.ChainIterator Maven / Gradle / Ivy
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 extends Iterable> metaIterator;
public ChainIterator(Iterator extends Iterable> metaIterator)
{
this.metaIterator = metaIterator;
}
public ChainIterator(Collection extends Iterable> 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