diff options
Diffstat (limited to 'guava/src/com/google/common/collect/ImmutableSortedSet.java')
-rw-r--r-- | guava/src/com/google/common/collect/ImmutableSortedSet.java | 151 |
1 files changed, 150 insertions, 1 deletions
diff --git a/guava/src/com/google/common/collect/ImmutableSortedSet.java b/guava/src/com/google/common/collect/ImmutableSortedSet.java index c730fa496..dc88e3983 100644 --- a/guava/src/com/google/common/collect/ImmutableSortedSet.java +++ b/guava/src/com/google/common/collect/ImmutableSortedSet.java @@ -64,7 +64,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; @GwtCompatible(serializable = true, emulated = true) @SuppressWarnings("serial") // we're overriding default serialization @ElementTypesAreNonnullByDefault -public abstract class ImmutableSortedSet<E> extends ImmutableSortedSetFauxverideShim<E> +public abstract class ImmutableSortedSet<E> extends ImmutableSet.CachingAsList<E> implements NavigableSet<E>, SortedIterable<E> { static final int SPLITERATOR_CHARACTERISTICS = ImmutableSet.SPLITERATOR_CHARACTERISTICS | Spliterator.SORTED; @@ -854,4 +854,153 @@ public abstract class ImmutableSortedSet<E> extends ImmutableSortedSetFauxveride Object writeReplace() { return new SerializedForm<E>(comparator, toArray()); } + + /** + * Not supported. Use {@link #toImmutableSortedSet} instead. This method exists only to hide + * {@link ImmutableSet#toImmutableSet} from consumers of {@code ImmutableSortedSet}. + * + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedSet#toImmutableSortedSet}. + * @since 21.0 + */ + @DoNotCall("Use toImmutableSortedSet") + @Deprecated + public static <E> Collector<E, ?, ImmutableSet<E>> toImmutableSet() { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. Use {@link #naturalOrder}, which offers better type-safety, instead. This method + * exists only to hide {@link ImmutableSet#builder} from consumers of {@code ImmutableSortedSet}. + * + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedSet#naturalOrder}, which offers better type-safety. + */ + @DoNotCall("Use naturalOrder") + @Deprecated + public static <E> ImmutableSortedSet.Builder<E> builder() { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. This method exists only to hide {@link ImmutableSet#builderWithExpectedSize} + * from consumers of {@code ImmutableSortedSet}. + * + * @throws UnsupportedOperationException always + * @deprecated Not supported by ImmutableSortedSet. + */ + @DoNotCall("Use naturalOrder (which does not accept an expected size)") + @Deprecated + public static <E> ImmutableSortedSet.Builder<E> builderWithExpectedSize(int expectedSize) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain a non-{@code Comparable} + * element.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass a parameter of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable)}.</b> + */ + @DoNotCall("Pass a parameter of type Comparable") + @Deprecated + public static <E> ImmutableSortedSet<E> of(E element) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain a non-{@code Comparable} + * element.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable)}.</b> + */ + @DoNotCall("Pass parameters of type Comparable") + @Deprecated + public static <E> ImmutableSortedSet<E> of(E e1, E e2) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain a non-{@code Comparable} + * element.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable, Comparable)}.</b> + */ + @DoNotCall("Pass parameters of type Comparable") + @Deprecated + public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain a non-{@code Comparable} + * element.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable)}. </b> + */ + @DoNotCall("Pass parameters of type Comparable") + @Deprecated + public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3, E e4) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain a non-{@code Comparable} + * element.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of( Comparable, Comparable, Comparable, Comparable, Comparable)}. </b> + */ + @DoNotCall("Pass parameters of type Comparable") + @Deprecated + public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3, E e4, E e5) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain a non-{@code Comparable} + * element.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable, Comparable, + * Comparable, Comparable...)}. </b> + */ + @DoNotCall("Pass parameters of type Comparable") + @Deprecated + public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... remaining) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. <b>You are attempting to create a set that may contain non-{@code Comparable} + * elements.</b> Proper calls will resolve to the version in {@code ImmutableSortedSet}, not this + * dummy version. + * + * @throws UnsupportedOperationException always + * @deprecated <b>Pass parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#copyOf(Comparable[])}.</b> + */ + @DoNotCall("Pass parameters of type Comparable") + @Deprecated + // The usage of "Z" here works around bugs in Javadoc (JDK-8318093) and JDiff. + public static <Z> ImmutableSortedSet<Z> copyOf(Z[] elements) { + throw new UnsupportedOperationException(); + } + + private static final long serialVersionUID = 0xcafebabe; } |