Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for covariantly (6.66 sec)

  1. guava/src/com/google/common/collect/ImmutableCollection.java

          }
          return newCapacity;
        }
    
        Builder() {}
    
        /**
         * Adds {@code element} to the {@code ImmutableCollection} being built.
         *
         * <p>Note that each builder class covariantly returns its own type from this method.
         *
         * @param element the element to add
         * @return this {@code Builder} instance
         * @throws NullPointerException if {@code element} is null
         */
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 18.7K bytes
    - Viewed (1)
  2. android/guava/src/com/google/common/collect/ImmutableCollection.java

          }
          return newCapacity;
        }
    
        Builder() {}
    
        /**
         * Adds {@code element} to the {@code ImmutableCollection} being built.
         *
         * <p>Note that each builder class covariantly returns its own type from this method.
         *
         * @param element the element to add
         * @return this {@code Builder} instance
         * @throws NullPointerException if {@code element} is null
         */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 21.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Iterators.java

          Iterator<? extends T> iterator) {
        if (iterator instanceof PeekingImpl) {
          // Safe to cast <? extends T> to <T> because PeekingImpl only uses T
          // covariantly (and cannot be subclassed to add non-covariant uses).
          @SuppressWarnings("unchecked")
          PeekingImpl<T> peeking = (PeekingImpl<T>) iterator;
          return peeking;
        }
        return new PeekingImpl<>(iterator);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Apr 30 18:43:01 GMT 2024
    - 51.1K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/Iterators.java

          Iterator<? extends T> iterator) {
        if (iterator instanceof PeekingImpl) {
          // Safe to cast <? extends T> to <T> because PeekingImpl only uses T
          // covariantly (and cannot be subclassed to add non-covariant uses).
          @SuppressWarnings("unchecked")
          PeekingImpl<T> peeking = (PeekingImpl<T>) iterator;
          return peeking;
        }
        return new PeekingImpl<>(iterator);
      }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Tue Jan 30 00:14:39 GMT 2024
    - 50.5K bytes
    - Viewed (0)
  5. 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
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 3K bytes
    - Viewed (0)
  6. 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
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 27 19:19:19 GMT 2024
    - 11K bytes
    - Viewed (0)
  7. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java

          if (entry instanceof ImmutableEntry) {
            checkNotNull(entry.getKey());
            checkNotNull(entry.getValue());
            @SuppressWarnings("unchecked") // all supported methods are covariant
            Entry<K, V> immutableEntry = (Entry<K, V>) entry;
            entries.add(immutableEntry);
          } else {
            entries.add(entryOf((K) entry.getKey(), (V) entry.getValue()));
          }
          return this;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 27 19:19:19 GMT 2024
    - 17.1K bytes
    - Viewed (0)
  8. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java

      public static <E> ImmutableSet<E> copyOf(Iterable<? extends E> elements) {
        if (elements instanceof ImmutableSet && !(elements instanceof ImmutableSortedSet)) {
          @SuppressWarnings("unchecked") // all supported methods are covariant
          ImmutableSet<E> set = (ImmutableSet<E>) elements;
          return set;
        }
        return copyOf(elements.iterator());
      }
    
      public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 23 18:43:40 GMT 2024
    - 8.3K 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;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 17.6K bytes
    - Viewed (0)
  10. android/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
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 18:32:41 GMT 2024
    - 10.5K bytes
    - Viewed (0)
Back to top