Applied-Energistics-2-tiler.../util/iterators/AEInvIterator.java

40 lines
626 B
Java
Raw Normal View History

2014-01-01 10:04:54 +01:00
package appeng.util.iterators;
import java.util.Iterator;
import appeng.api.storage.data.IAEItemStack;
import appeng.tile.inventory.AppEngInternalAEInventory;
public class AEInvIterator implements Iterator<IAEItemStack>
{
final AppEngInternalAEInventory inv;
final int size;
int x = 0;
public AEInvIterator(AppEngInternalAEInventory i) {
inv = i;
size = inv.getSizeInventory();
}
@Override
public boolean hasNext()
{
return x < size;
}
@Override
public IAEItemStack next()
{
return inv.getAEStackInSlot( x++ );
}
@Override
public void remove()
{
throw new RuntimeException( "no..." );
}
}