pt.java 5.07 KB
import com.google.common.collect.Multimap;
import com.google.common.collect.Multiset;
import com.google.common.collect.Multiset.Entry;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public final class pt
{
  public static <T> pt.a<T> a(Class<T> paramClass, String paramString)
  {
    try
    {
      paramClass = new pt.a(paramClass.getDeclaredField(paramString), (byte)0);
      return paramClass;
    }
    catch (NoSuchFieldException paramClass)
    {
      throw new AssertionError(paramClass);
    }
  }
  
  public static <K, V> void a(Multimap<K, V> paramMultimap, ObjectInputStream paramObjectInputStream)
    throws IOException, ClassNotFoundException
  {
    a(paramMultimap, paramObjectInputStream, paramObjectInputStream.readInt());
  }
  
  public static <K, V> void a(Multimap<K, V> paramMultimap, ObjectInputStream paramObjectInputStream, int paramInt)
    throws IOException, ClassNotFoundException
  {
    int i = 0;
    while (i < paramInt)
    {
      Collection localCollection = paramMultimap.get(paramObjectInputStream.readObject());
      int k = paramObjectInputStream.readInt();
      int j = 0;
      while (j < k)
      {
        localCollection.add(paramObjectInputStream.readObject());
        j += 1;
      }
      i += 1;
    }
  }
  
  public static <K, V> void a(Multimap<K, V> paramMultimap, ObjectOutputStream paramObjectOutputStream)
    throws IOException
  {
    paramObjectOutputStream.writeInt(paramMultimap.asMap().size());
    paramMultimap = paramMultimap.asMap().entrySet().iterator();
    while (paramMultimap.hasNext())
    {
      Object localObject = (Map.Entry)paramMultimap.next();
      paramObjectOutputStream.writeObject(((Map.Entry)localObject).getKey());
      paramObjectOutputStream.writeInt(((Collection)((Map.Entry)localObject).getValue()).size());
      localObject = ((Collection)((Map.Entry)localObject).getValue()).iterator();
      while (((Iterator)localObject).hasNext()) {
        paramObjectOutputStream.writeObject(((Iterator)localObject).next());
      }
    }
  }
  
  public static <E> void a(Multiset<E> paramMultiset, ObjectInputStream paramObjectInputStream)
    throws IOException, ClassNotFoundException
  {
    a(paramMultiset, paramObjectInputStream, paramObjectInputStream.readInt());
  }
  
  public static <E> void a(Multiset<E> paramMultiset, ObjectInputStream paramObjectInputStream, int paramInt)
    throws IOException, ClassNotFoundException
  {
    int i = 0;
    while (i < paramInt)
    {
      paramMultiset.add(paramObjectInputStream.readObject(), paramObjectInputStream.readInt());
      i += 1;
    }
  }
  
  public static <E> void a(Multiset<E> paramMultiset, ObjectOutputStream paramObjectOutputStream)
    throws IOException
  {
    paramObjectOutputStream.writeInt(paramMultiset.entrySet().size());
    paramMultiset = paramMultiset.entrySet().iterator();
    while (paramMultiset.hasNext())
    {
      Multiset.Entry localEntry = (Multiset.Entry)paramMultiset.next();
      paramObjectOutputStream.writeObject(localEntry.getElement());
      paramObjectOutputStream.writeInt(localEntry.getCount());
    }
  }
  
  public static <K, V> void a(Map<K, V> paramMap, ObjectInputStream paramObjectInputStream)
    throws IOException, ClassNotFoundException
  {
    a(paramMap, paramObjectInputStream, paramObjectInputStream.readInt());
  }
  
  public static <K, V> void a(Map<K, V> paramMap, ObjectInputStream paramObjectInputStream, int paramInt)
    throws IOException, ClassNotFoundException
  {
    int i = 0;
    while (i < paramInt)
    {
      paramMap.put(paramObjectInputStream.readObject(), paramObjectInputStream.readObject());
      i += 1;
    }
  }
  
  public static <K, V> void a(Map<K, V> paramMap, ObjectOutputStream paramObjectOutputStream)
    throws IOException
  {
    paramObjectOutputStream.writeInt(paramMap.size());
    paramMap = paramMap.entrySet().iterator();
    while (paramMap.hasNext())
    {
      Map.Entry localEntry = (Map.Entry)paramMap.next();
      paramObjectOutputStream.writeObject(localEntry.getKey());
      paramObjectOutputStream.writeObject(localEntry.getValue());
    }
  }
  
  public static final class a<T>
  {
    private final Field a;
    
    private a(Field paramField)
    {
      this.a = paramField;
      paramField.setAccessible(true);
    }
    
    public final void a(T paramT, int paramInt)
    {
      try
      {
        this.a.set(paramT, Integer.valueOf(paramInt));
        return;
      }
      catch (IllegalAccessException paramT)
      {
        throw new AssertionError(paramT);
      }
    }
    
    public final void a(T paramT, Object paramObject)
    {
      try
      {
        this.a.set(paramT, paramObject);
        return;
      }
      catch (IllegalAccessException paramT)
      {
        throw new AssertionError(paramT);
      }
    }
  }
}


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