Sets.java 27.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045
package com.google.common.collect;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import java.io.Serializable;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.NavigableSet;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import javax.annotation.Nullable;
import ms;
import ni;
import os;
import qf;

@GwtCompatible(emulated=true)
public final class Sets
{
  public static int a(Set<?> paramSet)
  {
    paramSet = paramSet.iterator();
    int i = 0;
    if (paramSet.hasNext())
    {
      Object localObject = paramSet.next();
      if (localObject != null) {}
      for (int j = localObject.hashCode();; j = 0)
      {
        i = i + j ^ 0xFFFFFFFF ^ 0xFFFFFFFF;
        break;
      }
    }
    return i;
  }
  
  private static <E extends Enum<E>> EnumSet<E> a(Collection<E> paramCollection, Class<E> paramClass)
  {
    paramClass = EnumSet.allOf(paramClass);
    paramClass.removeAll(paramCollection);
    return paramClass;
  }
  
  public static boolean a(Set<?> paramSet, @Nullable Object paramObject)
  {
    if (paramSet == paramObject) {}
    for (;;)
    {
      return true;
      if ((paramObject instanceof Set))
      {
        paramObject = (Set)paramObject;
        try
        {
          if (paramSet.size() == ((Set)paramObject).size())
          {
            boolean bool = paramSet.containsAll((Collection)paramObject);
            if (bool) {}
          }
          else
          {
            return false;
          }
        }
        catch (NullPointerException paramSet)
        {
          return false;
        }
        catch (ClassCastException paramSet)
        {
          return false;
        }
      }
    }
    return false;
  }
  
  public static boolean a(Set<?> paramSet, Collection<?> paramCollection)
  {
    Preconditions.checkNotNull(paramCollection);
    Object localObject = paramCollection;
    if ((paramCollection instanceof Multiset)) {
      localObject = ((Multiset)paramCollection).elementSet();
    }
    if (((localObject instanceof Set)) && (((Collection)localObject).size() > paramSet.size())) {
      return Iterators.removeAll(paramSet.iterator(), (Collection)localObject);
    }
    return a(paramSet, ((Collection)localObject).iterator());
  }
  
  public static boolean a(Set<?> paramSet, Iterator<?> paramIterator)
  {
    boolean bool = false;
    while (paramIterator.hasNext()) {
      bool |= paramSet.remove(paramIterator.next());
    }
    return bool;
  }
  
  public static <B> Set<List<B>> cartesianProduct(List<? extends Set<? extends B>> paramList)
  {
    return a.a(paramList);
  }
  
  public static <B> Set<List<B>> cartesianProduct(Set<? extends B>... paramVarArgs)
  {
    return cartesianProduct(Arrays.asList(paramVarArgs));
  }
  
  public static <E extends Enum<E>> EnumSet<E> complementOf(Collection<E> paramCollection)
  {
    if ((paramCollection instanceof EnumSet)) {
      return EnumSet.complementOf((EnumSet)paramCollection);
    }
    if (!paramCollection.isEmpty()) {}
    for (boolean bool = true;; bool = false)
    {
      Preconditions.checkArgument(bool, "collection is empty; use the other version of this method");
      return a(paramCollection, ((Enum)paramCollection.iterator().next()).getDeclaringClass());
    }
  }
  
  public static <E extends Enum<E>> EnumSet<E> complementOf(Collection<E> paramCollection, Class<E> paramClass)
  {
    Preconditions.checkNotNull(paramCollection);
    if ((paramCollection instanceof EnumSet)) {
      return EnumSet.complementOf((EnumSet)paramCollection);
    }
    return a(paramCollection, paramClass);
  }
  
  public static <E> SetView<E> difference(Set<E> paramSet, final Set<?> paramSet1)
  {
    Preconditions.checkNotNull(paramSet, "set1");
    Preconditions.checkNotNull(paramSet1, "set2");
    new SetView(paramSet)
    {
      public final boolean contains(Object paramAnonymousObject)
      {
        return (this.a.contains(paramAnonymousObject)) && (!paramSet1.contains(paramAnonymousObject));
      }
      
      public final boolean isEmpty()
      {
        return paramSet1.containsAll(this.a);
      }
      
      public final Iterator<E> iterator()
      {
        return Iterators.filter(this.a.iterator(), this.b);
      }
      
      public final int size()
      {
        return Iterators.size(iterator());
      }
    };
  }
  
  @GwtIncompatible("NavigableSet")
  public static <E> NavigableSet<E> filter(NavigableSet<E> paramNavigableSet, Predicate<? super E> paramPredicate)
  {
    if ((paramNavigableSet instanceof d))
    {
      paramNavigableSet = (d)paramNavigableSet;
      paramPredicate = Predicates.and(paramNavigableSet.b, paramPredicate);
      return new c((NavigableSet)paramNavigableSet.a, paramPredicate);
    }
    return new c((NavigableSet)Preconditions.checkNotNull(paramNavigableSet), (Predicate)Preconditions.checkNotNull(paramPredicate));
  }
  
  public static <E> Set<E> filter(Set<E> paramSet, Predicate<? super E> paramPredicate)
  {
    if ((paramSet instanceof SortedSet)) {
      return filter((SortedSet)paramSet, paramPredicate);
    }
    if ((paramSet instanceof d))
    {
      paramSet = (d)paramSet;
      paramPredicate = Predicates.and(paramSet.b, paramPredicate);
      return new d((Set)paramSet.a, paramPredicate);
    }
    return new d((Set)Preconditions.checkNotNull(paramSet), (Predicate)Preconditions.checkNotNull(paramPredicate));
  }
  
  public static <E> SortedSet<E> filter(SortedSet<E> paramSortedSet, Predicate<? super E> paramPredicate)
  {
    if ((paramSortedSet instanceof NavigableSet)) {
      return filter((NavigableSet)paramSortedSet, paramPredicate);
    }
    if ((paramSortedSet instanceof d))
    {
      paramSortedSet = (d)paramSortedSet;
      paramPredicate = Predicates.and(paramSortedSet.b, paramPredicate);
      return new e((SortedSet)paramSortedSet.a, paramPredicate);
    }
    return new e((SortedSet)Preconditions.checkNotNull(paramSortedSet), (Predicate)Preconditions.checkNotNull(paramPredicate));
  }
  
  @GwtCompatible(serializable=true)
  public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(E paramE, E... paramVarArgs)
  {
    return os.a(EnumSet.of(paramE, paramVarArgs));
  }
  
  @GwtCompatible(serializable=true)
  public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(Iterable<E> paramIterable)
  {
    if ((paramIterable instanceof os)) {
      return (os)paramIterable;
    }
    if ((paramIterable instanceof Collection))
    {
      paramIterable = (Collection)paramIterable;
      if (paramIterable.isEmpty()) {
        return ImmutableSet.of();
      }
      return os.a(EnumSet.copyOf(paramIterable));
    }
    paramIterable = paramIterable.iterator();
    if (paramIterable.hasNext())
    {
      EnumSet localEnumSet = EnumSet.of((Enum)paramIterable.next());
      Iterators.addAll(localEnumSet, paramIterable);
      return os.a(localEnumSet);
    }
    return ImmutableSet.of();
  }
  
  public static <E> SetView<E> intersection(Set<E> paramSet, final Set<?> paramSet1)
  {
    Preconditions.checkNotNull(paramSet, "set1");
    Preconditions.checkNotNull(paramSet1, "set2");
    new SetView(paramSet)
    {
      public final boolean contains(Object paramAnonymousObject)
      {
        return (this.a.contains(paramAnonymousObject)) && (paramSet1.contains(paramAnonymousObject));
      }
      
      public final boolean containsAll(Collection<?> paramAnonymousCollection)
      {
        return (this.a.containsAll(paramAnonymousCollection)) && (paramSet1.containsAll(paramAnonymousCollection));
      }
      
      public final boolean isEmpty()
      {
        return !iterator().hasNext();
      }
      
      public final Iterator<E> iterator()
      {
        return Iterators.filter(this.a.iterator(), this.b);
      }
      
      public final int size()
      {
        return Iterators.size(iterator());
      }
    };
  }
  
  public static <E> Set<E> newConcurrentHashSet()
  {
    return newSetFromMap(new ConcurrentHashMap());
  }
  
  public static <E> Set<E> newConcurrentHashSet(Iterable<? extends E> paramIterable)
  {
    Set localSet = newConcurrentHashSet();
    Iterables.addAll(localSet, paramIterable);
    return localSet;
  }
  
  @GwtIncompatible("CopyOnWriteArraySet")
  public static <E> CopyOnWriteArraySet<E> newCopyOnWriteArraySet()
  {
    return new CopyOnWriteArraySet();
  }
  
  @GwtIncompatible("CopyOnWriteArraySet")
  public static <E> CopyOnWriteArraySet<E> newCopyOnWriteArraySet(Iterable<? extends E> paramIterable)
  {
    if ((paramIterable instanceof Collection)) {}
    for (paramIterable = Collections2.a(paramIterable);; paramIterable = Lists.newArrayList(paramIterable)) {
      return new CopyOnWriteArraySet(paramIterable);
    }
  }
  
  public static <E extends Enum<E>> EnumSet<E> newEnumSet(Iterable<E> paramIterable, Class<E> paramClass)
  {
    paramClass = EnumSet.noneOf(paramClass);
    Iterables.addAll(paramClass, paramIterable);
    return paramClass;
  }
  
  public static <E> HashSet<E> newHashSet()
  {
    return new HashSet();
  }
  
  public static <E> HashSet<E> newHashSet(Iterable<? extends E> paramIterable)
  {
    if ((paramIterable instanceof Collection)) {
      return new HashSet(Collections2.a(paramIterable));
    }
    return newHashSet(paramIterable.iterator());
  }
  
  public static <E> HashSet<E> newHashSet(Iterator<? extends E> paramIterator)
  {
    HashSet localHashSet = newHashSet();
    Iterators.addAll(localHashSet, paramIterator);
    return localHashSet;
  }
  
  public static <E> HashSet<E> newHashSet(E... paramVarArgs)
  {
    HashSet localHashSet = newHashSetWithExpectedSize(paramVarArgs.length);
    Collections.addAll(localHashSet, paramVarArgs);
    return localHashSet;
  }
  
  public static <E> HashSet<E> newHashSetWithExpectedSize(int paramInt)
  {
    return new HashSet(Maps.a(paramInt));
  }
  
  public static <E> Set<E> newIdentityHashSet()
  {
    return newSetFromMap(Maps.newIdentityHashMap());
  }
  
  public static <E> LinkedHashSet<E> newLinkedHashSet()
  {
    return new LinkedHashSet();
  }
  
  public static <E> LinkedHashSet<E> newLinkedHashSet(Iterable<? extends E> paramIterable)
  {
    if ((paramIterable instanceof Collection)) {
      return new LinkedHashSet(Collections2.a(paramIterable));
    }
    LinkedHashSet localLinkedHashSet = newLinkedHashSet();
    Iterables.addAll(localLinkedHashSet, paramIterable);
    return localLinkedHashSet;
  }
  
  public static <E> LinkedHashSet<E> newLinkedHashSetWithExpectedSize(int paramInt)
  {
    return new LinkedHashSet(Maps.a(paramInt));
  }
  
  public static <E> Set<E> newSetFromMap(Map<E, Boolean> paramMap)
  {
    return Collections.newSetFromMap(paramMap);
  }
  
  public static <E extends Comparable> TreeSet<E> newTreeSet()
  {
    return new TreeSet();
  }
  
  public static <E extends Comparable> TreeSet<E> newTreeSet(Iterable<? extends E> paramIterable)
  {
    TreeSet localTreeSet = newTreeSet();
    Iterables.addAll(localTreeSet, paramIterable);
    return localTreeSet;
  }
  
  public static <E> TreeSet<E> newTreeSet(Comparator<? super E> paramComparator)
  {
    return new TreeSet((Comparator)Preconditions.checkNotNull(paramComparator));
  }
  
  @GwtCompatible(serializable=false)
  public static <E> Set<Set<E>> powerSet(Set<E> paramSet)
  {
    return new g(paramSet);
  }
  
  public static <E> SetView<E> symmetricDifference(Set<? extends E> paramSet1, Set<? extends E> paramSet2)
  {
    Preconditions.checkNotNull(paramSet1, "set1");
    Preconditions.checkNotNull(paramSet2, "set2");
    return difference(union(paramSet1, paramSet2), intersection(paramSet1, paramSet2));
  }
  
  @GwtIncompatible("NavigableSet")
  public static <E> NavigableSet<E> synchronizedNavigableSet(NavigableSet<E> paramNavigableSet)
  {
    return qf.a(paramNavigableSet, null);
  }
  
  public static <E> SetView<E> union(Set<? extends E> paramSet1, final Set<? extends E> paramSet2)
  {
    Preconditions.checkNotNull(paramSet1, "set1");
    Preconditions.checkNotNull(paramSet2, "set2");
    new SetView(paramSet1)
    {
      public final boolean contains(Object paramAnonymousObject)
      {
        return (this.a.contains(paramAnonymousObject)) || (paramSet2.contains(paramAnonymousObject));
      }
      
      public final <S extends Set<E>> S copyInto(S paramAnonymousS)
      {
        paramAnonymousS.addAll(this.a);
        paramAnonymousS.addAll(paramSet2);
        return paramAnonymousS;
      }
      
      public final ImmutableSet<E> immutableCopy()
      {
        return new ImmutableSet.Builder().addAll(this.a).addAll(paramSet2).build();
      }
      
      public final boolean isEmpty()
      {
        return (this.a.isEmpty()) && (paramSet2.isEmpty());
      }
      
      public final Iterator<E> iterator()
      {
        return Iterators.unmodifiableIterator(Iterators.concat(this.a.iterator(), this.b.iterator()));
      }
      
      public final int size()
      {
        return this.a.size() + this.b.size();
      }
    };
  }
  
  @GwtIncompatible("NavigableSet")
  public static <E> NavigableSet<E> unmodifiableNavigableSet(NavigableSet<E> paramNavigableSet)
  {
    if (((paramNavigableSet instanceof ImmutableSortedSet)) || ((paramNavigableSet instanceof i))) {
      return paramNavigableSet;
    }
    return new i(paramNavigableSet);
  }
  
  public static abstract class SetView<E>
    extends AbstractSet<E>
  {
    public <S extends Set<E>> S copyInto(S paramS)
    {
      paramS.addAll(this);
      return paramS;
    }
    
    public ImmutableSet<E> immutableCopy()
    {
      return ImmutableSet.copyOf(this);
    }
  }
  
  static final class a<E>
    extends ForwardingCollection<List<E>>
    implements Set<List<E>>
  {
    private final transient ImmutableList<ImmutableSet<E>> a;
    private final transient ni<E> b;
    
    private a(ImmutableList<ImmutableSet<E>> paramImmutableList, ni<E> paramni)
    {
      this.a = paramImmutableList;
      this.b = paramni;
    }
    
    static <E> Set<List<E>> a(List<? extends Set<? extends E>> paramList)
    {
      ImmutableList.Builder localBuilder = new ImmutableList.Builder(paramList.size());
      paramList = paramList.iterator();
      while (paramList.hasNext())
      {
        ImmutableSet localImmutableSet = ImmutableSet.copyOf((Set)paramList.next());
        if (localImmutableSet.isEmpty()) {
          return ImmutableSet.of();
        }
        localBuilder.add(localImmutableSet);
      }
      paramList = localBuilder.build();
      new a(paramList, new ni(new ImmutableList()
      {
        final boolean a()
        {
          return true;
        }
        
        public final int size()
        {
          return this.a.size();
        }
      }));
    }
    
    protected final Collection<List<E>> delegate()
    {
      return this.b;
    }
    
    public final boolean equals(@Nullable Object paramObject)
    {
      if ((paramObject instanceof a))
      {
        paramObject = (a)paramObject;
        return this.a.equals(((a)paramObject).a);
      }
      return super.equals(paramObject);
    }
    
    public final int hashCode()
    {
      int i = size() - 1;
      int j = 0;
      while (j < this.a.size())
      {
        i = i * 31 ^ 0xFFFFFFFF ^ 0xFFFFFFFF;
        j += 1;
      }
      Iterator localIterator = this.a.iterator();
      Set localSet;
      int k;
      for (j = 1; localIterator.hasNext(); j = localSet.hashCode() * k + j * 31 ^ 0xFFFFFFFF ^ 0xFFFFFFFF)
      {
        localSet = (Set)localIterator.next();
        k = size() / localSet.size();
      }
      return j + i ^ 0xFFFFFFFF ^ 0xFFFFFFFF;
    }
  }
  
  @GwtIncompatible("NavigableSet")
  static class b<E>
    extends ForwardingNavigableSet<E>
  {
    private final NavigableSet<E> a;
    
    b(NavigableSet<E> paramNavigableSet)
    {
      this.a = paramNavigableSet;
    }
    
    public E ceiling(E paramE)
    {
      return (E)this.a.floor(paramE);
    }
    
    public Comparator<? super E> comparator()
    {
      Comparator localComparator = this.a.comparator();
      if (localComparator == null) {
        return Ordering.natural().reverse();
      }
      return Ordering.from(localComparator).reverse();
    }
    
    protected NavigableSet<E> delegate()
    {
      return this.a;
    }
    
    public Iterator<E> descendingIterator()
    {
      return this.a.iterator();
    }
    
    public NavigableSet<E> descendingSet()
    {
      return this.a;
    }
    
    public E first()
    {
      return (E)this.a.last();
    }
    
    public E floor(E paramE)
    {
      return (E)this.a.ceiling(paramE);
    }
    
    public NavigableSet<E> headSet(E paramE, boolean paramBoolean)
    {
      return this.a.tailSet(paramE, paramBoolean).descendingSet();
    }
    
    public SortedSet<E> headSet(E paramE)
    {
      return standardHeadSet(paramE);
    }
    
    public E higher(E paramE)
    {
      return (E)this.a.lower(paramE);
    }
    
    public Iterator<E> iterator()
    {
      return this.a.descendingIterator();
    }
    
    public E last()
    {
      return (E)this.a.first();
    }
    
    public E lower(E paramE)
    {
      return (E)this.a.higher(paramE);
    }
    
    public E pollFirst()
    {
      return (E)this.a.pollLast();
    }
    
    public E pollLast()
    {
      return (E)this.a.pollFirst();
    }
    
    public NavigableSet<E> subSet(E paramE1, boolean paramBoolean1, E paramE2, boolean paramBoolean2)
    {
      return this.a.subSet(paramE2, paramBoolean2, paramE1, paramBoolean1).descendingSet();
    }
    
    public SortedSet<E> subSet(E paramE1, E paramE2)
    {
      return standardSubSet(paramE1, paramE2);
    }
    
    public NavigableSet<E> tailSet(E paramE, boolean paramBoolean)
    {
      return this.a.headSet(paramE, paramBoolean).descendingSet();
    }
    
    public SortedSet<E> tailSet(E paramE)
    {
      return standardTailSet(paramE);
    }
    
    public Object[] toArray()
    {
      return standardToArray();
    }
    
    public <T> T[] toArray(T[] paramArrayOfT)
    {
      return standardToArray(paramArrayOfT);
    }
    
    public String toString()
    {
      return standardToString();
    }
  }
  
  @GwtIncompatible("NavigableSet")
  static final class c<E>
    extends Sets.e<E>
    implements NavigableSet<E>
  {
    c(NavigableSet<E> paramNavigableSet, Predicate<? super E> paramPredicate)
    {
      super(paramPredicate);
    }
    
    public final E ceiling(E paramE)
    {
      return (E)Iterables.getFirst(tailSet(paramE, true), null);
    }
    
    public final Iterator<E> descendingIterator()
    {
      return Iterators.filter(((NavigableSet)this.a).descendingIterator(), this.b);
    }
    
    public final NavigableSet<E> descendingSet()
    {
      return Sets.filter(((NavigableSet)this.a).descendingSet(), this.b);
    }
    
    @Nullable
    public final E floor(E paramE)
    {
      return (E)Iterators.getNext(headSet(paramE, true).descendingIterator(), null);
    }
    
    public final NavigableSet<E> headSet(E paramE, boolean paramBoolean)
    {
      return Sets.filter(((NavigableSet)this.a).headSet(paramE, paramBoolean), this.b);
    }
    
    public final E higher(E paramE)
    {
      return (E)Iterables.getFirst(tailSet(paramE, false), null);
    }
    
    public final E last()
    {
      return (E)descendingIterator().next();
    }
    
    @Nullable
    public final E lower(E paramE)
    {
      return (E)Iterators.getNext(headSet(paramE, false).descendingIterator(), null);
    }
    
    public final E pollFirst()
    {
      return (E)Iterables.a((NavigableSet)this.a, this.b);
    }
    
    public final E pollLast()
    {
      return (E)Iterables.a(((NavigableSet)this.a).descendingSet(), this.b);
    }
    
    public final NavigableSet<E> subSet(E paramE1, boolean paramBoolean1, E paramE2, boolean paramBoolean2)
    {
      return Sets.filter(((NavigableSet)this.a).subSet(paramE1, paramBoolean1, paramE2, paramBoolean2), this.b);
    }
    
    public final NavigableSet<E> tailSet(E paramE, boolean paramBoolean)
    {
      return Sets.filter(((NavigableSet)this.a).tailSet(paramE, paramBoolean), this.b);
    }
  }
  
  static class d<E>
    extends Collections2.a<E>
    implements Set<E>
  {
    d(Set<E> paramSet, Predicate<? super E> paramPredicate)
    {
      super(paramPredicate);
    }
    
    public boolean equals(@Nullable Object paramObject)
    {
      return Sets.a(this, paramObject);
    }
    
    public int hashCode()
    {
      return Sets.a(this);
    }
  }
  
  static class e<E>
    extends Sets.d<E>
    implements SortedSet<E>
  {
    e(SortedSet<E> paramSortedSet, Predicate<? super E> paramPredicate)
    {
      super(paramPredicate);
    }
    
    public Comparator<? super E> comparator()
    {
      return ((SortedSet)this.a).comparator();
    }
    
    public E first()
    {
      return (E)iterator().next();
    }
    
    public SortedSet<E> headSet(E paramE)
    {
      return new e(((SortedSet)this.a).headSet(paramE), this.b);
    }
    
    public E last()
    {
      Object localObject;
      for (SortedSet localSortedSet = (SortedSet)this.a;; localSortedSet = localSortedSet.headSet(localObject))
      {
        localObject = localSortedSet.last();
        if (this.b.apply(localObject)) {
          return (E)localObject;
        }
      }
    }
    
    public SortedSet<E> subSet(E paramE1, E paramE2)
    {
      return new e(((SortedSet)this.a).subSet(paramE1, paramE2), this.b);
    }
    
    public SortedSet<E> tailSet(E paramE)
    {
      return new e(((SortedSet)this.a).tailSet(paramE), this.b);
    }
  }
  
  public static abstract class f<E>
    extends AbstractSet<E>
  {
    public boolean removeAll(Collection<?> paramCollection)
    {
      return Sets.a(this, paramCollection);
    }
    
    public boolean retainAll(Collection<?> paramCollection)
    {
      return super.retainAll((Collection)Preconditions.checkNotNull(paramCollection));
    }
  }
  
  static final class g<E>
    extends AbstractSet<Set<E>>
  {
    final ImmutableMap<E, Integer> a;
    
    g(Set<E> paramSet)
    {
      ImmutableMap.Builder localBuilder = ImmutableMap.builder();
      paramSet = ((Set)Preconditions.checkNotNull(paramSet)).iterator();
      int i = 0;
      while (paramSet.hasNext())
      {
        localBuilder.put(paramSet.next(), Integer.valueOf(i));
        i += 1;
      }
      this.a = localBuilder.build();
      if (this.a.size() <= 30) {}
      for (boolean bool = true;; bool = false)
      {
        Preconditions.checkArgument(bool, "Too many elements to create power set: %s > 30", new Object[] { Integer.valueOf(this.a.size()) });
        return;
      }
    }
    
    public final boolean contains(@Nullable Object paramObject)
    {
      if ((paramObject instanceof Set))
      {
        paramObject = (Set)paramObject;
        return this.a.keySet().containsAll((Collection)paramObject);
      }
      return false;
    }
    
    public final boolean equals(@Nullable Object paramObject)
    {
      if ((paramObject instanceof g))
      {
        paramObject = (g)paramObject;
        return this.a.equals(((g)paramObject).a);
      }
      return super.equals(paramObject);
    }
    
    public final int hashCode()
    {
      return this.a.keySet().hashCode() << this.a.size() - 1;
    }
    
    public final boolean isEmpty()
    {
      return false;
    }
    
    public final Iterator<Set<E>> iterator()
    {
      new ms(size()) {};
    }
    
    public final int size()
    {
      return 1 << this.a.size();
    }
    
    public final String toString()
    {
      String str = String.valueOf(String.valueOf(this.a));
      return str.length() + 10 + "powerSet(" + str + ")";
    }
  }
  
  static final class h<E>
    extends AbstractSet<E>
  {
    private final ImmutableMap<E, Integer> a;
    private final int b;
    
    h(ImmutableMap<E, Integer> paramImmutableMap, int paramInt)
    {
      this.a = paramImmutableMap;
      this.b = paramInt;
    }
    
    public final boolean contains(@Nullable Object paramObject)
    {
      paramObject = (Integer)this.a.get(paramObject);
      if (paramObject != null)
      {
        int i = this.b;
        if ((1 << ((Integer)paramObject).intValue() & i) != 0) {
          return true;
        }
      }
      return false;
    }
    
    public final Iterator<E> iterator()
    {
      new UnmodifiableIterator()
      {
        final ImmutableList<E> a = Sets.h.a(Sets.h.this).keySet().asList();
        int b = Sets.h.b(Sets.h.this);
        
        public final boolean hasNext()
        {
          return this.b != 0;
        }
        
        public final E next()
        {
          int i = Integer.numberOfTrailingZeros(this.b);
          if (i == 32) {
            throw new NoSuchElementException();
          }
          this.b &= (1 << i ^ 0xFFFFFFFF);
          return (E)this.a.get(i);
        }
      };
    }
    
    public final int size()
    {
      return Integer.bitCount(this.b);
    }
  }
  
  @GwtIncompatible("NavigableSet")
  static final class i<E>
    extends ForwardingSortedSet<E>
    implements Serializable, NavigableSet<E>
  {
    private static final long serialVersionUID = 0L;
    private final NavigableSet<E> a;
    private transient i<E> b;
    
    i(NavigableSet<E> paramNavigableSet)
    {
      this.a = ((NavigableSet)Preconditions.checkNotNull(paramNavigableSet));
    }
    
    public final E ceiling(E paramE)
    {
      return (E)this.a.ceiling(paramE);
    }
    
    protected final SortedSet<E> delegate()
    {
      return Collections.unmodifiableSortedSet(this.a);
    }
    
    public final Iterator<E> descendingIterator()
    {
      return Iterators.unmodifiableIterator(this.a.descendingIterator());
    }
    
    public final NavigableSet<E> descendingSet()
    {
      i locali2 = this.b;
      i locali1 = locali2;
      if (locali2 == null)
      {
        locali1 = new i(this.a.descendingSet());
        this.b = locali1;
        locali1.b = this;
      }
      return locali1;
    }
    
    public final E floor(E paramE)
    {
      return (E)this.a.floor(paramE);
    }
    
    public final NavigableSet<E> headSet(E paramE, boolean paramBoolean)
    {
      return Sets.unmodifiableNavigableSet(this.a.headSet(paramE, paramBoolean));
    }
    
    public final E higher(E paramE)
    {
      return (E)this.a.higher(paramE);
    }
    
    public final E lower(E paramE)
    {
      return (E)this.a.lower(paramE);
    }
    
    public final E pollFirst()
    {
      throw new UnsupportedOperationException();
    }
    
    public final E pollLast()
    {
      throw new UnsupportedOperationException();
    }
    
    public final NavigableSet<E> subSet(E paramE1, boolean paramBoolean1, E paramE2, boolean paramBoolean2)
    {
      return Sets.unmodifiableNavigableSet(this.a.subSet(paramE1, paramBoolean1, paramE2, paramBoolean2));
    }
    
    public final NavigableSet<E> tailSet(E paramE, boolean paramBoolean)
    {
      return Sets.unmodifiableNavigableSet(this.a.tailSet(paramE, paramBoolean));
    }
  }
}


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