package com.google.android.m4b.maps.bl;

import com.google.android.m4b.maps.bs.d;
import java.util.ArrayList;
import java.util.Iterator;

public final class ae
  implements Iterator<d>
{
  private ArrayList<Iterator<d>> a = new ArrayList();
  private d[] b;
  private int c = 0;

  private void c()
  {
    this.b = new d[this.a.size()];
    for (int i = 0; i < this.a.size(); i++)
    {
      Iterator localIterator = (Iterator)this.a.get(i);
      this.b[i] = ((d)localIterator.next());
      if (!localIterator.hasNext())
        this.a.set(i, null);
    }
  }

  public final d a()
  {
    int i = -1;
    if (this.b == null)
      c();
    int j = 0;
    int k = i;
    int n;
    if (j < this.b.length)
    {
      if ((this.b[j] == null) || (this.b[j].b() <= i))
        break label163;
      n = this.b[j].b();
    }
    label163: int m;
    for (int i1 = j; ; i1 = m)
    {
      j++;
      int i2 = i1;
      i = n;
      k = i2;
      break;
      d locald = this.b[k];
      Iterator localIterator = (Iterator)this.a.get(k);
      if (localIterator != null)
      {
        this.b[k] = ((d)localIterator.next());
        if (!localIterator.hasNext())
          this.a.set(k, null);
        return locald;
      }
      this.b[k] = null;
      this.c = (1 + this.c);
      return locald;
      m = k;
      n = i;
    }
  }

  public final void a(Iterator<d> paramIterator)
  {
    if (this.b != null)
      throw new IllegalStateException("Cannot call addIterator after next has been called");
    if (paramIterator.hasNext())
      this.a.add(paramIterator);
  }

  public final d b()
  {
    int i = -1;
    if (this.b == null)
      c();
    int j = 0;
    int k = i;
    while (j < this.b.length)
    {
      if ((this.b[j] != null) && (this.b[j].b() > k))
      {
        k = this.b[j].b();
        i = j;
      }
      j++;
    }
    return this.b[i];
  }

  public final boolean hasNext()
  {
    return this.c < this.a.size();
  }

  public final void remove()
  {
    throw new UnsupportedOperationException();
  }

  public final String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder("[RankMergingFeatureIterator");
    for (int i = 0; i < this.a.size(); i++)
      localStringBuilder.append('|').append(this.a.get(i));
    return ']';
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bl.ae
 * JD-Core Version:    0.6.2
 */