mm$m.java 3.86 KB
import com.google.common.base.Preconditions;
import com.google.common.cache.AbstractCache.SimpleStatsCounter;
import com.google.common.cache.AbstractCache.StatsCounter;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.CacheStats;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.io.Serializable;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import javax.annotation.Nullable;

public class mm$m<K, V>
  implements Cache<K, V>, Serializable
{
  private static final long serialVersionUID = 1L;
  final mm<K, V> a;
  
  public mm$m(CacheBuilder<? super K, ? super V> paramCacheBuilder)
  {
    this(new mm(paramCacheBuilder, null));
  }
  
  private mm$m(mm<K, V> parammm)
  {
    this.a = parammm;
  }
  
  public ConcurrentMap<K, V> asMap()
  {
    return this.a;
  }
  
  public void cleanUp()
  {
    mm.q[] arrayOfq = this.a.d;
    int j = arrayOfq.length;
    int i = 0;
    while (i < j)
    {
      arrayOfq[i].b();
      i += 1;
    }
  }
  
  public V get(K paramK, final Callable<? extends V> paramCallable)
    throws ExecutionException
  {
    Preconditions.checkNotNull(paramCallable);
    (V)this.a.a(paramK, new CacheLoader()
    {
      public final V load(Object paramAnonymousObject)
        throws Exception
      {
        return (V)paramCallable.call();
      }
    });
  }
  
  public ImmutableMap<K, V> getAllPresent(Iterable<?> paramIterable)
  {
    int j = 0;
    mm localmm = this.a;
    LinkedHashMap localLinkedHashMap = Maps.newLinkedHashMap();
    paramIterable = paramIterable.iterator();
    int i = 0;
    while (paramIterable.hasNext())
    {
      Object localObject1 = paramIterable.next();
      Object localObject2 = localmm.get(localObject1);
      if (localObject2 == null)
      {
        j += 1;
      }
      else
      {
        localLinkedHashMap.put(localObject1, localObject2);
        i += 1;
      }
    }
    localmm.s.recordHits(i);
    localmm.s.recordMisses(j);
    return ImmutableMap.copyOf(localLinkedHashMap);
  }
  
  @Nullable
  public V getIfPresent(Object paramObject)
  {
    mm localmm = this.a;
    int i = localmm.a(Preconditions.checkNotNull(paramObject));
    paramObject = localmm.a(i).a(paramObject, i);
    if (paramObject == null)
    {
      localmm.s.recordMisses(1);
      return (V)paramObject;
    }
    localmm.s.recordHits(1);
    return (V)paramObject;
  }
  
  public void invalidate(Object paramObject)
  {
    Preconditions.checkNotNull(paramObject);
    this.a.remove(paramObject);
  }
  
  public void invalidateAll()
  {
    this.a.clear();
  }
  
  public void invalidateAll(Iterable<?> paramIterable)
  {
    mm localmm = this.a;
    paramIterable = paramIterable.iterator();
    while (paramIterable.hasNext()) {
      localmm.remove(paramIterable.next());
    }
  }
  
  public void put(K paramK, V paramV)
  {
    this.a.put(paramK, paramV);
  }
  
  public void putAll(Map<? extends K, ? extends V> paramMap)
  {
    this.a.putAll(paramMap);
  }
  
  public long size()
  {
    return this.a.m();
  }
  
  public CacheStats stats()
  {
    AbstractCache.SimpleStatsCounter localSimpleStatsCounter = new AbstractCache.SimpleStatsCounter();
    localSimpleStatsCounter.incrementBy(this.a.s);
    mm.q[] arrayOfq = this.a.d;
    int j = arrayOfq.length;
    int i = 0;
    while (i < j)
    {
      localSimpleStatsCounter.incrementBy(arrayOfq[i].n);
      i += 1;
    }
    return localSimpleStatsCounter.snapshot();
  }
  
  Object writeReplace()
  {
    return new mm.n(this.a);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/mm$m.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */