Package appeng.parts.automation

Source Code of appeng.parts.automation.NonNullArrayIterator

package appeng.parts.automation;

import java.util.Iterator;

import scala.NotImplementedError;

public class NonNullArrayIterator<E> implements Iterator<E>
{

  int offset = 0;
  final E[] g;

  public NonNullArrayIterator(E[] o) {
    g = o;
  }

  @Override
  public boolean hasNext()
  {
    while (offset < g.length && g[offset] == null)
      offset++;

    return offset != g.length;
  }

  @Override
  public E next()
  {
    return g[offset++];
  }

  @Override
  public void remove()
  {
    throw new NotImplementedError();
  }

}
TOP

Related Classes of appeng.parts.automation.NonNullArrayIterator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.