Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 46 for covariant (0.07 sec)

  1. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java

           * TODO: When given an ImmutableList that's a sublist, copy the referenced
           * portion of the array into a new array to save space?
           */
          @SuppressWarnings("unchecked") // all supported methods are covariant
          ImmutableCollection<E> list = (ImmutableCollection<E>) elements;
          return list.asList();
        }
        return copyFromCollection(elements);
      }
    
      @JsMethod
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jun 14 22:14:46 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/base/OptionalTest.java

        FluentIterable<? extends Number> numbers = getSomeNumbers();
    
        // Sadly, the following is what users will have to do in some circumstances.
    
        @SuppressWarnings("unchecked") // safe covariant cast
        Optional<Number> first = (Optional<Number>) numbers.first();
        Number value = first.or(0.5); // fine
      }
    
      @J2ktIncompatible
      @GwtIncompatible // NullPointerTester
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Tables.java

        UnmodifiableTable(Table<? extends R, ? extends C, ? extends V> delegate) {
          this.delegate = checkNotNull(delegate);
        }
    
        @SuppressWarnings("unchecked") // safe, covariant cast
        @Override
        protected Table<R, C, V> delegate() {
          return (Table<R, C, V>) delegate;
        }
    
        @Override
        public Set<Cell<R, C, V>> cellSet() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 21:21:17 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/ImmutableList.java

       */
      public static <E> ImmutableList<E> copyOf(Collection<? extends E> elements) {
        if (elements instanceof ImmutableCollection) {
          @SuppressWarnings("unchecked") // all supported methods are covariant
          ImmutableList<E> list = ((ImmutableCollection<E>) elements).asList();
          return list.isPartialView() ? ImmutableList.<E>asImmutableList(list.toArray()) : list;
        }
        return construct(elements.toArray());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 21:21:17 UTC 2024
    - 27.7K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/base/Optional.java

     * href="https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained#optional">using {@code
     * Optional}</a>.
     *
     * @param <T> the type of instance that can be contained. {@code Optional} is naturally covariant on
     *     this type, so it is safe to cast an {@code Optional<T>} to {@code Optional<S>} for any
     *     supertype {@code S} of {@code T}.
     * @author Kurt Alfred Kluever
     * @author Kevin Bourrillion
     * @since 10.0
     */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/ImmutableCollection.java

       * array with a nullable element type. But probably they usually want an array with a non-nullable
       * type. That said, we could *accept* a `@Nullable T[]` (which, given that we treat arrays as
       * covariant, would still permit a plain `T[]`) and return a plain `T[]`. But of course that would
       * require its own suppression, since it is also unsound. toArray(T[]) is just a mess from a
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Aug 12 16:59:15 UTC 2024
    - 18.8K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/Multisets.java

          Multiset<? extends E> multiset) {
        if (multiset instanceof UnmodifiableMultiset || multiset instanceof ImmutableMultiset) {
          @SuppressWarnings("unchecked") // Since it's unmodifiable, the covariant cast is safe
          Multiset<E> result = (Multiset<E>) multiset;
          return result;
        }
        return new UnmodifiableMultiset<>(checkNotNull(multiset));
      }
    
      /**
       * Simply returns its argument.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/Multisets.java

          Multiset<? extends E> multiset) {
        if (multiset instanceof UnmodifiableMultiset || multiset instanceof ImmutableMultiset) {
          @SuppressWarnings("unchecked") // Since it's unmodifiable, the covariant cast is safe
          Multiset<E> result = (Multiset<E>) multiset;
          return result;
        }
        return new UnmodifiableMultiset<>(checkNotNull(multiset));
      }
    
      /**
       * Simply returns its argument.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 41.5K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/ImmutableTable.java

            checkNotNull(cell.getRowKey(), "row");
            checkNotNull(cell.getColumnKey(), "column");
            checkNotNull(cell.getValue(), "value");
            @SuppressWarnings("unchecked") // all supported methods are covariant
            Cell<R, C, V> immutableCell = (Cell<R, C, V>) cell;
            cells.add(immutableCell);
          } else {
            put(cell.getRowKey(), cell.getColumnKey(), cell.getValue());
          }
          return this;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/ImmutableList.java

       */
      public static <E> ImmutableList<E> copyOf(Collection<? extends E> elements) {
        if (elements instanceof ImmutableCollection) {
          @SuppressWarnings("unchecked") // all supported methods are covariant
          ImmutableList<E> list = ((ImmutableCollection<E>) elements).asList();
          return list.isPartialView() ? ImmutableList.<E>asImmutableList(list.toArray()) : list;
        }
        return construct(elements.toArray());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Aug 16 19:14:45 UTC 2024
    - 30.5K bytes
    - Viewed (0)
Back to top