package com.google.common.util.concurrent;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Ordering;
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;

public final class Futures
{
  private static final AsyncFunction<ListenableFuture<Object>, Object> DEREFERENCER = new AsyncFunction()
  {
  };
  private static final Ordering<Constructor<?>> WITH_STRING_PARAM_FIRST = Ordering.natural().onResultOf(new Function()
  {
    public Boolean apply(Constructor<?> paramAnonymousConstructor)
    {
      return Boolean.valueOf(Arrays.asList(paramAnonymousConstructor.getParameterTypes()).contains(String.class));
    }
  }).reverse();

  public static <V> ListenableFuture<V> immediateFuture(@Nullable V paramV)
  {
    return new ImmediateSuccessfulFuture(paramV);
  }

  private static abstract class ImmediateFuture<V>
    implements ListenableFuture<V>
  {
    private static final Logger log = Logger.getLogger(ImmediateFuture.class.getName());

    public void addListener(Runnable paramRunnable, Executor paramExecutor)
    {
      Preconditions.checkNotNull(paramRunnable, "Runnable was null.");
      Preconditions.checkNotNull(paramExecutor, "Executor was null.");
      try
      {
        paramExecutor.execute(paramRunnable);
        return;
      }
      catch (RuntimeException localRuntimeException)
      {
        log.log(Level.SEVERE, "RuntimeException while executing runnable " + paramRunnable + " with executor " + paramExecutor, localRuntimeException);
      }
    }

    public boolean cancel(boolean paramBoolean)
    {
      return false;
    }

    public abstract V get()
      throws ExecutionException;

    public V get(long paramLong, TimeUnit paramTimeUnit)
      throws ExecutionException
    {
      Preconditions.checkNotNull(paramTimeUnit);
      return get();
    }

    public boolean isCancelled()
    {
      return false;
    }

    public boolean isDone()
    {
      return true;
    }
  }

  private static class ImmediateSuccessfulFuture<V> extends Futures.ImmediateFuture<V>
  {

    @Nullable
    private final V value;

    ImmediateSuccessfulFuture(@Nullable V paramV)
    {
      super();
      this.value = paramV;
    }

    public V get()
    {
      return this.value;
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.common.util.concurrent.Futures
 * JD-Core Version:    0.6.2
 */