private static ImmutableSortedSet copyOfInternal(Comparator comparator1, Iterable iterable) { if (SortedIterables.hasSameComparator(comparator1, iterable) && (iterable instanceof ImmutableSortedSet)) { ImmutableSortedSet immutablesortedset = (ImmutableSortedSet) iterable; if (!immutablesortedset.isPartialView()) return immutablesortedset; } ImmutableList immutablelist = ImmutableList.copyOf(SortedIterables.sortedUnique(comparator1, iterable)); Object obj; if (immutablelist.isEmpty()) obj = emptySet(comparator1); else obj = new RegularImmutableSortedSet(immutablelist, comparator1); return ((ImmutableSortedSet) (obj)); }
public static ImmutableSortedSet copyOfSorted(SortedSet paramSortedSet) { Comparator localComparator = SortedIterables.comparator(paramSortedSet); Object[] arrayOfObject = paramSortedSet.toArray(); if (arrayOfObject.length == 0) { return emptySet(localComparator); } return new RegularImmutableSortedSet(ImmutableList.asImmutableList(arrayOfObject), localComparator); }
public static ImmutableSortedSet copyOf(Comparator paramComparator, Iterable paramIterable) { Preconditions.checkNotNull(paramComparator); boolean bool = SortedIterables.hasSameComparator(paramComparator, paramIterable); if ((bool) && ((paramIterable instanceof ImmutableSortedSet))) { localObject = (ImmutableSortedSet)paramIterable; if (!((ImmutableSortedSet)localObject).isPartialView()) { return (ImmutableSortedSet)localObject; } } Object localObject = (Object[])Iterables.toArray(paramIterable); return construct(paramComparator, localObject.length, (Object[])localObject); }
private static ImmutableSortedSet copyOfInternal(Comparator comparator1, Iterator iterator1) { ImmutableList immutablelist = ImmutableList.copyOf(SortedIterables.sortedUnique(comparator1, iterator1)); if (immutablelist.isEmpty()) return emptySet(comparator1); else return new RegularImmutableSortedSet(immutablelist, comparator1); }