package com.google.android.m4b.maps.ar;

import java.lang.ref.SoftReference;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public abstract class c<T>
{
  private final int a;
  private final LinkedList<SoftReference<T>> b = new LinkedList();
  private int c;
  private int d;

  public c(int paramInt, String paramString)
  {
    this.a = paramInt;
  }

  protected abstract T a();

  public final void a(List<T> paramList)
  {
    synchronized (this.b)
    {
      Iterator localIterator = paramList.iterator();
      if (localIterator.hasNext())
      {
        Object localObject2 = localIterator.next();
        if (this.b.size() == this.a)
          this.b.removeFirst();
        this.b.add(new SoftReference(localObject2));
      }
    }
  }

  public final T b()
  {
    synchronized (this.b)
    {
      if (!this.b.isEmpty())
      {
        Object localObject2 = ((SoftReference)this.b.removeLast()).get();
        if (localObject2 != null)
        {
          this.d = (1 + this.d);
          return localObject2;
        }
      }
      this.c = (1 + this.c);
      return a();
    }
  }
}

/* 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.c
 * JD-Core Version:    0.6.2
 */