Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 66 for covariant (0.06 sec)

  1. android/guava/src/com/google/common/collect/RegularImmutableAsList.java

      @Override
      ImmutableCollection<E> delegateCollection() {
        return delegate;
      }
    
      ImmutableList<? extends E> delegateList() {
        return delegateList;
      }
    
      @SuppressWarnings("unchecked") // safe covariant cast!
      @Override
      public UnmodifiableListIterator<E> listIterator(int index) {
        return (UnmodifiableListIterator<E>) delegateList.listIterator(index);
      }
    
      @GwtIncompatible // not present in emulated superclass
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Nov 30 21:54:06 UTC 2023
    - 3K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/RegularImmutableAsList.java

      @Override
      ImmutableCollection<E> delegateCollection() {
        return delegate;
      }
    
      ImmutableList<? extends E> delegateList() {
        return delegateList;
      }
    
      @SuppressWarnings("unchecked") // safe covariant cast!
      @Override
      public UnmodifiableListIterator<E> listIterator(int index) {
        return (UnmodifiableListIterator<E>) delegateList.listIterator(index);
      }
    
      @GwtIncompatible // not present in emulated superclass
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Nov 30 21:54:06 UTC 2023
    - 3K bytes
    - Viewed (0)
  3. 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)
  4. guava/src/com/google/common/collect/ImmutableClassToInstanceMap.java

        if (map instanceof ImmutableClassToInstanceMap) {
          @SuppressWarnings("rawtypes") // JDT-based J2KT Java frontend does not permit the direct cast
          Map rawMap = map;
          @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable)
          ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap<B>) rawMap;
          return cast;
        }
        return new Builder<B>().putAll(map).build();
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed May 10 21:56:03 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/ImmutableClassToInstanceMap.java

        if (map instanceof ImmutableClassToInstanceMap) {
          @SuppressWarnings("rawtypes") // JDT-based J2KT Java frontend does not permit the direct cast
          Map rawMap = map;
          @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable)
          ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap<B>) rawMap;
          return cast;
        }
        return new Builder<B>().putAll(map).build();
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed May 10 21:56:03 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top