oh.java 5.5 KB
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.ForwardingCollection;
import com.google.common.collect.ForwardingList;
import com.google.common.collect.ForwardingSet;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multiset;
import com.google.common.collect.Multisets;
import com.google.common.collect.SetMultimap;
import com.google.common.collect.Sets;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.annotation.Nullable;

@GwtCompatible
public class oh<K, V>
  extends mx<K, V>
  implements oj<K, V>
{
  public final Multimap<K, V> a;
  public final Predicate<? super K> b;
  
  public oh(Multimap<K, V> paramMultimap, Predicate<? super K> paramPredicate)
  {
    this.a = ((Multimap)Preconditions.checkNotNull(paramMultimap));
    this.b = ((Predicate)Preconditions.checkNotNull(paramPredicate));
  }
  
  public Multimap<K, V> a()
  {
    return this.a;
  }
  
  public final Predicate<? super Map.Entry<K, V>> b()
  {
    return Maps.a(this.b);
  }
  
  public void clear()
  {
    keySet().clear();
  }
  
  public boolean containsKey(@Nullable Object paramObject)
  {
    if (this.a.containsKey(paramObject)) {
      return this.b.apply(paramObject);
    }
    return false;
  }
  
  final Set<K> e()
  {
    return Sets.filter(this.a.keySet(), this.b);
  }
  
  final Iterator<Map.Entry<K, V>> g()
  {
    throw new AssertionError("should never be called");
  }
  
  public Collection<V> get(K paramK)
  {
    if (this.b.apply(paramK)) {
      return this.a.get(paramK);
    }
    if ((this.a instanceof SetMultimap)) {
      return new oh.b(paramK);
    }
    return new oh.a(paramK);
  }
  
  final Map<K, Collection<V>> h()
  {
    return Maps.filterKeys(this.a.asMap(), this.b);
  }
  
  Collection<Map.Entry<K, V>> i()
  {
    return new oh.c();
  }
  
  final Multiset<K> j()
  {
    return Multisets.filter(this.a.keys(), this.b);
  }
  
  final Collection<V> k()
  {
    return new ok(this);
  }
  
  public Collection<V> removeAll(Object paramObject)
  {
    if (containsKey(paramObject)) {
      return this.a.removeAll(paramObject);
    }
    if ((this.a instanceof SetMultimap)) {
      return ImmutableSet.of();
    }
    return ImmutableList.of();
  }
  
  public int size()
  {
    Iterator localIterator = asMap().values().iterator();
    for (int i = 0; localIterator.hasNext(); i = ((Collection)localIterator.next()).size() + i) {}
    return i;
  }
  
  static final class a<K, V>
    extends ForwardingList<V>
  {
    final K a;
    
    a(K paramK)
    {
      this.a = paramK;
    }
    
    public final void add(int paramInt, V paramV)
    {
      Preconditions.checkPositionIndex(paramInt, 0);
      paramV = String.valueOf(String.valueOf(this.a));
      throw new IllegalArgumentException(paramV.length() + 32 + "Key does not satisfy predicate: " + paramV);
    }
    
    public final boolean add(V paramV)
    {
      add(0, paramV);
      return true;
    }
    
    public final boolean addAll(int paramInt, Collection<? extends V> paramCollection)
    {
      Preconditions.checkNotNull(paramCollection);
      Preconditions.checkPositionIndex(paramInt, 0);
      paramCollection = String.valueOf(String.valueOf(this.a));
      throw new IllegalArgumentException(paramCollection.length() + 32 + "Key does not satisfy predicate: " + paramCollection);
    }
    
    public final boolean addAll(Collection<? extends V> paramCollection)
    {
      addAll(0, paramCollection);
      return true;
    }
    
    protected final List<V> delegate()
    {
      return Collections.emptyList();
    }
  }
  
  static final class b<K, V>
    extends ForwardingSet<V>
  {
    final K a;
    
    b(K paramK)
    {
      this.a = paramK;
    }
    
    public final boolean add(V paramV)
    {
      paramV = String.valueOf(String.valueOf(this.a));
      throw new IllegalArgumentException(paramV.length() + 32 + "Key does not satisfy predicate: " + paramV);
    }
    
    public final boolean addAll(Collection<? extends V> paramCollection)
    {
      Preconditions.checkNotNull(paramCollection);
      paramCollection = String.valueOf(String.valueOf(this.a));
      throw new IllegalArgumentException(paramCollection.length() + 32 + "Key does not satisfy predicate: " + paramCollection);
    }
    
    protected final Set<V> delegate()
    {
      return Collections.emptySet();
    }
  }
  
  class c
    extends ForwardingCollection<Map.Entry<K, V>>
  {
    c() {}
    
    protected Collection<Map.Entry<K, V>> delegate()
    {
      return Collections2.filter(oh.this.a.entries(), Maps.a(oh.this.b));
    }
    
    public boolean remove(@Nullable Object paramObject)
    {
      if ((paramObject instanceof Map.Entry))
      {
        paramObject = (Map.Entry)paramObject;
        if ((oh.this.a.containsKey(((Map.Entry)paramObject).getKey())) && (oh.this.b.apply(((Map.Entry)paramObject).getKey()))) {
          return oh.this.a.remove(((Map.Entry)paramObject).getKey(), ((Map.Entry)paramObject).getValue());
        }
      }
      return false;
    }
  }
}


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