package com.google.android.m4b.maps.ag;

import java.util.HashMap;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Set;

public final class d
{
  private Object[] a = new Object[Math.min(16, 128)];
  private HashMap<Integer, Object> b;
  private int c = -2147483648;
  private int d = -2147483648;
  private int e = 0;

  public d()
  {
    this(16);
  }

  private d(int paramInt)
  {
  }

  public final a a()
  {
    return new a();
  }

  public final Object a(int paramInt)
  {
    Object localObject;
    if ((paramInt <= this.c) && (paramInt >= 0))
      localObject = this.a[paramInt];
    HashMap localHashMap;
    do
    {
      int i;
      do
      {
        return localObject;
        i = this.d;
        localObject = null;
      }
      while (paramInt > i);
      localHashMap = this.b;
      localObject = null;
    }
    while (localHashMap == null);
    return this.b.get(f.a(paramInt));
  }

  public final void a(int paramInt, Object paramObject)
  {
    if (paramObject == null)
    {
      b(paramInt);
      return;
    }
    if (paramInt > this.d)
      this.d = paramInt;
    if ((paramInt < 0) || (paramInt >= this.a.length))
    {
      int i = 0;
      if (paramInt < 128)
      {
        int j = this.a.length;
        i = 0;
        if (paramInt >= j)
        {
          i = 0;
          if (paramInt > 0)
          {
            int k = this.a.length;
            do
              k <<= 1;
            while (k <= paramInt);
            Object[] arrayOfObject = new Object[Math.min(k, 128)];
            System.arraycopy(this.a, 0, arrayOfObject, 0, this.a.length);
            this.a = arrayOfObject;
            i = 1;
          }
        }
      }
      if (i == 0);
    }
    else
    {
      if (paramInt > this.c)
      {
        this.c = paramInt;
        this.e = (1 + this.e);
      }
      while (true)
      {
        this.a[paramInt] = paramObject;
        return;
        if (this.a[paramInt] == null)
          this.e = (1 + this.e);
      }
    }
    if (this.b == null)
      this.b = new HashMap();
    this.b.put(f.a(paramInt), paramObject);
  }

  public final int b()
  {
    return this.d;
  }

  public final Object b(int paramInt)
  {
    if ((paramInt >= 0) && (paramInt < this.a.length))
    {
      Object localObject = this.a[paramInt];
      if (localObject != null)
        this.e = (-1 + this.e);
      this.a[paramInt] = null;
      return localObject;
    }
    if (this.b != null)
      return this.b.remove(f.a(paramInt));
    return null;
  }

  public final int c()
  {
    if (this.b == null)
      return this.e;
    return this.e + this.b.size();
  }

  public final void d()
  {
    for (int i = 0; i < this.a.length; i++)
      this.a[i] = null;
    if (this.b != null)
      this.b.clear();
    this.d = -2147483648;
    this.c = -2147483648;
    this.e = 0;
  }

  public final boolean equals(Object paramObject)
  {
    if (this == paramObject)
      return true;
    if ((paramObject == null) || (!(paramObject instanceof d)))
      return false;
    d locald = (d)paramObject;
    if (c() != locald.c())
      return false;
    Object[] arrayOfObject1 = this.a;
    Object[] arrayOfObject2 = locald.a;
    int i = Math.min(arrayOfObject1.length, arrayOfObject2.length);
    int j = 0;
    int k;
    if (j < i)
      if (((arrayOfObject1[j] == null) && (arrayOfObject2[j] != null)) || ((arrayOfObject1[j] != null) && (!arrayOfObject1[j].equals(arrayOfObject2[j]))))
        k = 0;
    while (true)
    {
      if ((k == 0) || (!this.b.equals(locald.b)))
        break label212;
      return true;
      j++;
      break;
      if (arrayOfObject1.length > arrayOfObject2.length)
        while (true)
        {
          if (i >= arrayOfObject1.length)
            break label206;
          if (arrayOfObject1[i] != null)
          {
            k = 0;
            break;
          }
          i++;
        }
      if (arrayOfObject1.length < arrayOfObject2.length)
        while (true)
        {
          if (i >= arrayOfObject2.length)
            break label206;
          if (arrayOfObject2[i] != null)
          {
            k = 0;
            break;
          }
          i++;
        }
      label206: k = 1;
    }
    label212: return false;
  }

  public final int hashCode()
  {
    int i = 1;
    for (int j = 0; j < this.a.length; j++)
    {
      Object localObject = this.a[j];
      if (localObject != null)
        i = j + (i * 31 + localObject.hashCode());
    }
    if (this.b == null)
      return i;
    return i + this.b.hashCode();
  }

  public final String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder("IntMap{lower:");
    for (int i = 0; i < this.a.length; i++)
      if (this.a[i] != null)
      {
        localStringBuilder.append(i);
        localStringBuilder.append("=>");
        localStringBuilder.append(this.a[i]);
        localStringBuilder.append(", ");
      }
    localStringBuilder.append(", higher:" + this.b + "}");
    return localStringBuilder.toString();
  }

  public final class a
  {
    private int a = 0;
    private int b = -2147483648;
    private Iterator<Integer> c = null;

    public a()
    {
    }

    public final boolean a()
    {
      if (this.b != -2147483648)
        return true;
      if (this.a <= d.a(d.this))
        while (this.a <= d.a(d.this))
        {
          if (d.b(d.this)[this.a] != null)
          {
            int i = this.a;
            this.a = (i + 1);
            this.b = i;
            return true;
          }
          this.a = (1 + this.a);
        }
      if (d.c(d.this) != null)
      {
        if (this.c == null)
          this.c = d.c(d.this).keySet().iterator();
        if (this.c.hasNext())
        {
          this.b = ((Integer)this.c.next()).intValue();
          return true;
        }
      }
      return false;
    }

    public final int b()
    {
      if (!a())
        throw new NoSuchElementException();
      int i = this.b;
      this.b = -2147483648;
      return 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.ag.d
 * JD-Core Version:    0.6.2
 */