mx.java 6.14 KB
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterators;
import com.google.common.collect.Maps;
import com.google.common.collect.Maps.n;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import com.google.common.collect.Multimaps.f;
import com.google.common.collect.Multimaps.g;
import com.google.common.collect.Multiset;
import com.google.common.collect.SetMultimap;
import com.google.common.collect.Sets;
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.annotation.Nullable;

@GwtCompatible
public abstract class mx<K, V>
  implements Multimap<K, V>
{
  private transient Collection<Map.Entry<K, V>> a;
  private transient Set<K> b;
  private transient Multiset<K> c;
  private transient Collection<V> d;
  private transient Map<K, Collection<V>> e;
  
  public Map<K, Collection<V>> asMap()
  {
    Map localMap2 = this.e;
    Map localMap1 = localMap2;
    if (localMap2 == null)
    {
      localMap1 = h();
      this.e = localMap1;
    }
    return localMap1;
  }
  
  public boolean containsEntry(@Nullable Object paramObject1, @Nullable Object paramObject2)
  {
    paramObject1 = (Collection)asMap().get(paramObject1);
    return (paramObject1 != null) && (((Collection)paramObject1).contains(paramObject2));
  }
  
  public boolean containsValue(@Nullable Object paramObject)
  {
    Iterator localIterator = asMap().values().iterator();
    while (localIterator.hasNext()) {
      if (((Collection)localIterator.next()).contains(paramObject)) {
        return true;
      }
    }
    return false;
  }
  
  protected Set<K> e()
  {
    return new Maps.n(asMap());
  }
  
  public Collection<Map.Entry<K, V>> entries()
  {
    Collection localCollection2 = this.a;
    Collection localCollection1 = localCollection2;
    if (localCollection2 == null)
    {
      localCollection1 = i();
      this.a = localCollection1;
    }
    return localCollection1;
  }
  
  public boolean equals(@Nullable Object paramObject)
  {
    return Multimaps.a(this, paramObject);
  }
  
  public Iterator<V> f()
  {
    return Maps.b(entries().iterator());
  }
  
  public abstract Iterator<Map.Entry<K, V>> g();
  
  public abstract Map<K, Collection<V>> h();
  
  public int hashCode()
  {
    return asMap().hashCode();
  }
  
  protected Collection<Map.Entry<K, V>> i()
  {
    if ((this instanceof SetMultimap)) {
      return new mx.b((byte)0);
    }
    return new mx.a((byte)0);
  }
  
  public boolean isEmpty()
  {
    return size() == 0;
  }
  
  protected Multiset<K> j()
  {
    return new Multimaps.g(this);
  }
  
  public Collection<V> k()
  {
    return new mx.c();
  }
  
  public Set<K> keySet()
  {
    Set localSet2 = this.b;
    Set localSet1 = localSet2;
    if (localSet2 == null)
    {
      localSet1 = e();
      this.b = localSet1;
    }
    return localSet1;
  }
  
  public Multiset<K> keys()
  {
    Multiset localMultiset2 = this.c;
    Multiset localMultiset1 = localMultiset2;
    if (localMultiset2 == null)
    {
      localMultiset1 = j();
      this.c = localMultiset1;
    }
    return localMultiset1;
  }
  
  public boolean put(@Nullable K paramK, @Nullable V paramV)
  {
    return get(paramK).add(paramV);
  }
  
  public boolean putAll(Multimap<? extends K, ? extends V> paramMultimap)
  {
    paramMultimap = paramMultimap.entries().iterator();
    Map.Entry localEntry;
    for (boolean bool = false; paramMultimap.hasNext(); bool = put(localEntry.getKey(), localEntry.getValue()) | bool) {
      localEntry = (Map.Entry)paramMultimap.next();
    }
    return bool;
  }
  
  public boolean putAll(@Nullable K paramK, Iterable<? extends V> paramIterable)
  {
    Preconditions.checkNotNull(paramIterable);
    if ((paramIterable instanceof Collection))
    {
      paramIterable = (Collection)paramIterable;
      if ((paramIterable.isEmpty()) || (!get(paramK).addAll(paramIterable))) {}
    }
    do
    {
      return true;
      return false;
      paramIterable = paramIterable.iterator();
    } while ((paramIterable.hasNext()) && (Iterators.addAll(get(paramK), paramIterable)));
    return false;
  }
  
  public boolean remove(@Nullable Object paramObject1, @Nullable Object paramObject2)
  {
    paramObject1 = (Collection)asMap().get(paramObject1);
    return (paramObject1 != null) && (((Collection)paramObject1).remove(paramObject2));
  }
  
  public Collection<V> replaceValues(@Nullable K paramK, Iterable<? extends V> paramIterable)
  {
    Preconditions.checkNotNull(paramIterable);
    Collection localCollection = removeAll(paramK);
    putAll(paramK, paramIterable);
    return localCollection;
  }
  
  public String toString()
  {
    return asMap().toString();
  }
  
  public Collection<V> values()
  {
    Collection localCollection2 = this.d;
    Collection localCollection1 = localCollection2;
    if (localCollection2 == null)
    {
      localCollection1 = k();
      this.d = localCollection1;
    }
    return localCollection1;
  }
  
  class a
    extends Multimaps.f<K, V>
  {
    private a() {}
    
    final Multimap<K, V> a()
    {
      return mx.this;
    }
    
    public Iterator<Map.Entry<K, V>> iterator()
    {
      return mx.this.g();
    }
  }
  
  final class b
    extends mx<K, V>.a
    implements Set<Map.Entry<K, V>>
  {
    private b()
    {
      super((byte)0);
    }
    
    public final boolean equals(@Nullable Object paramObject)
    {
      return Sets.a(this, paramObject);
    }
    
    public final int hashCode()
    {
      return Sets.a(this);
    }
  }
  
  final class c
    extends AbstractCollection<V>
  {
    c() {}
    
    public final void clear()
    {
      mx.this.clear();
    }
    
    public final boolean contains(@Nullable Object paramObject)
    {
      return mx.this.containsValue(paramObject);
    }
    
    public final Iterator<V> iterator()
    {
      return mx.this.f();
    }
    
    public final int size()
    {
      return mx.this.size();
    }
  }
}


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