qc.java 4.91 KB
import com.google.common.annotations.GwtCompatible;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.common.collect.Table.Cell;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.annotation.concurrent.Immutable;

@GwtCompatible
@Immutable
public final class qc<R, C, V>
  extends pq<R, C, V>
{
  private final ImmutableMap<R, Map<C, V>> a;
  private final ImmutableMap<C, Map<R, V>> b;
  private final int[] c;
  private final int[] d;
  
  public qc(ImmutableList<Table.Cell<R, C, V>> paramImmutableList, ImmutableSet<R> paramImmutableSet, ImmutableSet<C> paramImmutableSet1)
  {
    HashMap localHashMap = Maps.newHashMap();
    Object localObject1 = Maps.newLinkedHashMap();
    paramImmutableSet = paramImmutableSet.iterator();
    Object localObject2;
    while (paramImmutableSet.hasNext())
    {
      localObject2 = paramImmutableSet.next();
      localHashMap.put(localObject2, Integer.valueOf(((Map)localObject1).size()));
      ((Map)localObject1).put(localObject2, new LinkedHashMap());
    }
    paramImmutableSet = Maps.newLinkedHashMap();
    paramImmutableSet1 = paramImmutableSet1.iterator();
    while (paramImmutableSet1.hasNext()) {
      paramImmutableSet.put(paramImmutableSet1.next(), new LinkedHashMap());
    }
    int[] arrayOfInt1 = new int[paramImmutableList.size()];
    int[] arrayOfInt2 = new int[paramImmutableList.size()];
    int i = 0;
    while (i < paramImmutableList.size())
    {
      localObject2 = (Table.Cell)paramImmutableList.get(i);
      Object localObject4 = ((Table.Cell)localObject2).getRowKey();
      paramImmutableSet1 = ((Table.Cell)localObject2).getColumnKey();
      localObject2 = ((Table.Cell)localObject2).getValue();
      arrayOfInt1[i] = ((Integer)localHashMap.get(localObject4)).intValue();
      Object localObject3 = (Map)((Map)localObject1).get(localObject4);
      arrayOfInt2[i] = ((Map)localObject3).size();
      localObject3 = ((Map)localObject3).put(paramImmutableSet1, localObject2);
      if (localObject3 != null)
      {
        paramImmutableList = String.valueOf(String.valueOf(localObject4));
        paramImmutableSet = String.valueOf(String.valueOf(paramImmutableSet1));
        paramImmutableSet1 = String.valueOf(String.valueOf(localObject2));
        localObject1 = String.valueOf(String.valueOf(localObject3));
        throw new IllegalArgumentException(paramImmutableList.length() + 37 + paramImmutableSet.length() + paramImmutableSet1.length() + ((String)localObject1).length() + "Duplicate value for row=" + paramImmutableList + ", column=" + paramImmutableSet + ": " + paramImmutableSet1 + ", " + (String)localObject1);
      }
      ((Map)paramImmutableSet.get(paramImmutableSet1)).put(localObject4, localObject2);
      i += 1;
    }
    this.c = arrayOfInt1;
    this.d = arrayOfInt2;
    paramImmutableList = ImmutableMap.builder();
    paramImmutableSet1 = ((Map)localObject1).entrySet().iterator();
    while (paramImmutableSet1.hasNext())
    {
      localObject1 = (Map.Entry)paramImmutableSet1.next();
      paramImmutableList.put(((Map.Entry)localObject1).getKey(), ImmutableMap.copyOf((Map)((Map.Entry)localObject1).getValue()));
    }
    this.a = paramImmutableList.build();
    paramImmutableList = ImmutableMap.builder();
    paramImmutableSet = paramImmutableSet.entrySet().iterator();
    while (paramImmutableSet.hasNext())
    {
      paramImmutableSet1 = (Map.Entry)paramImmutableSet.next();
      paramImmutableList.put(paramImmutableSet1.getKey(), ImmutableMap.copyOf((Map)paramImmutableSet1.getValue()));
    }
    this.b = paramImmutableList.build();
  }
  
  final Table.Cell<R, C, V> a(int paramInt)
  {
    int i = this.c[paramInt];
    Map.Entry localEntry = (Map.Entry)this.a.entrySet().asList().get(i);
    Object localObject = (ImmutableMap)localEntry.getValue();
    paramInt = this.d[paramInt];
    localObject = (Map.Entry)((ImmutableMap)localObject).entrySet().asList().get(paramInt);
    return a(localEntry.getKey(), ((Map.Entry)localObject).getKey(), ((Map.Entry)localObject).getValue());
  }
  
  final V b(int paramInt)
  {
    int i = this.c[paramInt];
    ImmutableMap localImmutableMap = (ImmutableMap)this.a.values().asList().get(i);
    paramInt = this.d[paramInt];
    return (V)localImmutableMap.values().asList().get(paramInt);
  }
  
  public final ImmutableMap<C, Map<R, V>> columnMap()
  {
    return this.b;
  }
  
  public final ImmutableMap<R, Map<C, V>> rowMap()
  {
    return this.a;
  }
  
  public final int size()
  {
    return this.c.length;
  }
}


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