pg.java 5.13 KB
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Preconditions;
import com.google.common.collect.AbstractSequentialIterator;
import com.google.common.collect.BoundType;
import com.google.common.collect.Collections2;
import com.google.common.collect.ContiguousSet;
import com.google.common.collect.DiscreteDomain;
import com.google.common.collect.Ordering;
import com.google.common.collect.Range;
import com.google.common.collect.Sets;
import com.google.common.collect.UnmodifiableIterator;
import java.io.Serializable;
import java.util.Collection;
import javax.annotation.Nullable;

@GwtCompatible(emulated=true)
public final class pg<C extends Comparable>
  extends ContiguousSet<C>
{
  private static final long serialVersionUID = 0L;
  private final Range<C> d;
  
  public pg(Range<C> paramRange, DiscreteDomain<C> paramDiscreteDomain)
  {
    super(paramDiscreteDomain);
    this.d = paramRange;
  }
  
  private ContiguousSet<C> a(Range<C> paramRange)
  {
    if (this.d.isConnected(paramRange)) {
      return ContiguousSet.create(this.d.intersection(paramRange), this.a);
    }
    return new nv(this.a);
  }
  
  @GwtIncompatible("not used by GWT emulation")
  final int a(Object paramObject)
  {
    if (contains(paramObject)) {
      return (int)this.a.distance(d(), (Comparable)paramObject);
    }
    return -1;
  }
  
  final ContiguousSet<C> a(C paramC, boolean paramBoolean)
  {
    return a(Range.upTo(paramC, BoundType.a(paramBoolean)));
  }
  
  final ContiguousSet<C> a(C paramC1, boolean paramBoolean1, C paramC2, boolean paramBoolean2)
  {
    if ((paramC1.compareTo(paramC2) == 0) && (!paramBoolean1) && (!paramBoolean2)) {
      return new nv(this.a);
    }
    return a(Range.range(paramC1, BoundType.a(paramBoolean1), paramC2, BoundType.a(paramBoolean2)));
  }
  
  final boolean a()
  {
    return false;
  }
  
  final ContiguousSet<C> b(C paramC, boolean paramBoolean)
  {
    return a(Range.downTo(paramC, BoundType.a(paramBoolean)));
  }
  
  public final boolean contains(@Nullable Object paramObject)
  {
    if (paramObject == null) {
      return false;
    }
    try
    {
      boolean bool = this.d.contains((Comparable)paramObject);
      return bool;
    }
    catch (ClassCastException paramObject) {}
    return false;
  }
  
  public final boolean containsAll(Collection<?> paramCollection)
  {
    return Collections2.a(this, paramCollection);
  }
  
  public final C d()
  {
    return this.d.b.a(this.a);
  }
  
  @GwtIncompatible("NavigableSet")
  public final UnmodifiableIterator<C> descendingIterator()
  {
    new AbstractSequentialIterator(e())
    {
      final C a = pg.this.d();
    };
  }
  
  public final C e()
  {
    return this.d.c.b(this.a);
  }
  
  public final boolean equals(@Nullable Object paramObject)
  {
    if (paramObject == this) {
      return true;
    }
    if ((paramObject instanceof pg))
    {
      pg localpg = (pg)paramObject;
      if (this.a.equals(localpg.a)) {
        return (d().equals(localpg.d())) && (e().equals(localpg.e()));
      }
    }
    return super.equals(paramObject);
  }
  
  public final int hashCode()
  {
    return Sets.a(this);
  }
  
  public final ContiguousSet<C> intersection(ContiguousSet<C> paramContiguousSet)
  {
    Preconditions.checkNotNull(paramContiguousSet);
    Preconditions.checkArgument(this.a.equals(paramContiguousSet.a));
    if (paramContiguousSet.isEmpty()) {
      return paramContiguousSet;
    }
    Comparable localComparable = (Comparable)Ordering.natural().max(d(), paramContiguousSet.first());
    paramContiguousSet = (Comparable)Ordering.natural().min(e(), paramContiguousSet.last());
    if (localComparable.compareTo(paramContiguousSet) < 0) {
      return ContiguousSet.create(Range.closed(localComparable, paramContiguousSet), this.a);
    }
    return new nv(this.a);
  }
  
  public final boolean isEmpty()
  {
    return false;
  }
  
  public final UnmodifiableIterator<C> iterator()
  {
    new AbstractSequentialIterator(d())
    {
      final C a = pg.this.e();
    };
  }
  
  public final Range<C> range()
  {
    return range(BoundType.CLOSED, BoundType.CLOSED);
  }
  
  public final Range<C> range(BoundType paramBoundType1, BoundType paramBoundType2)
  {
    return Range.a(this.d.b.a(paramBoundType1, this.a), this.d.c.b(paramBoundType2, this.a));
  }
  
  public final int size()
  {
    long l = this.a.distance(d(), e());
    if (l >= 2147483647L) {
      return Integer.MAX_VALUE;
    }
    return (int)l + 1;
  }
  
  @GwtIncompatible("serialization")
  final Object writeReplace()
  {
    return new pg.a(this.d, this.a, (byte)0);
  }
  
  @GwtIncompatible("serialization")
  static final class a<C extends Comparable>
    implements Serializable
  {
    final Range<C> a;
    final DiscreteDomain<C> b;
    
    private a(Range<C> paramRange, DiscreteDomain<C> paramDiscreteDomain)
    {
      this.a = paramRange;
      this.b = paramDiscreteDomain;
    }
    
    private Object readResolve()
    {
      return new pg(this.a, this.b);
    }
  }
}


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