package com.google.android.m4b.maps.ar;

import java.util.LinkedList;

public abstract class a<T>
{
  protected final LinkedList<T> a = new LinkedList();
  protected int b;
  public T c;
  public int d;
  private final c<T> e;
  private final int f;
  private final int g;
  private final int h;
  private int i;

  public a(int paramInt1, int paramInt2, c<T> paramc)
  {
    this.h = paramInt2;
    this.f = (1 << paramInt2);
    this.g = (-1 + this.f);
    this.e = paramc;
    this.i = d(paramInt1);
    a();
  }

  private int d(int paramInt)
  {
    int j = paramInt >> this.h;
    if ((paramInt & this.g) != 0);
    for (int k = 1; ; k = 0)
      return k + j;
  }

  public final T a(int paramInt)
  {
    if (paramInt > this.i)
      throw new IndexOutOfBoundsException("Index out of bound : " + paramInt + "(index) > " + this.i + "(size)");
    while (paramInt >= this.a.size())
      this.a.add(this.e.b());
    return this.a.get(paramInt);
  }

  public final void a()
  {
    this.b = 0;
    this.d = 0;
    this.c = a(0);
  }

  public final void a(T paramT, int paramInt)
  {
    a();
    int j = 0;
    while (j < paramInt)
    {
      int k = this.f;
      if (j + this.f > paramInt)
        k = paramInt - j;
      System.arraycopy(paramT, j, a(this.b), 0, k);
      j += k;
      if (k == this.f)
      {
        this.b = (1 + this.b);
        this.d = 0;
      }
      else
      {
        this.d = k;
      }
    }
  }

  public final int b()
  {
    return this.a.size() << this.h;
  }

  public final void b(int paramInt)
  {
    if (paramInt >= this.f)
    {
      int j = paramInt & this.g;
      this.b = (1 + this.b);
      if (this.b != this.i)
      {
        Object localObject = this.c;
        this.c = a(this.b);
        if (j != 0)
          System.arraycopy(localObject, this.f, this.c, 0, j);
      }
      this.d = j;
      return;
    }
    this.d = paramInt;
  }

  public final void c()
  {
    this.e.a(this.a);
    this.a.clear();
  }

  public final void c(int paramInt)
  {
    this.i = Math.max(d(paramInt), this.i);
  }
}

/* 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.ar.a
 * JD-Core Version:    0.6.2
 */