Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for SingletonImmutableSet (0.6 sec)

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

    import static com.google.common.base.Preconditions.checkNotNull;
    
    import org.checkerframework.checker.nullness.qual.Nullable;
    
    /**
     * GWT emulation of {@link SingletonImmutableSet}.
     *
     * @author Hayward Chan
     */
    @ElementTypesAreNonnullByDefault
    final class SingletonImmutableSet<E> extends ImmutableSet<E> {
    
      // This reference is used both by the custom field serializer, and by the
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 23 18:43:40 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/SingletonImmutableSet.java

    @ElementTypesAreNonnullByDefault
    final class SingletonImmutableSet<E> extends ImmutableSet<E> {
      // We deliberately avoid caching the asList and hashCode here, to ensure that with
      // compressed oops, a SingletonImmutableSet packs all the way down to the optimal 16 bytes.
    
      final transient E element;
    
      SingletonImmutableSet(E element) {
        this.element = Preconditions.checkNotNull(element);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  3. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java

      @SuppressWarnings({"unchecked"})
      public static <E> ImmutableSet<E> of() {
        return (ImmutableSet<E>) RegularImmutableSet.EMPTY;
      }
    
      public static <E> ImmutableSet<E> of(E element) {
        return new SingletonImmutableSet<E>(element);
      }
    
      @SuppressWarnings("unchecked")
      public static <E> ImmutableSet<E> of(E e1, E e2) {
        return create(e1, e2);
      }
    
      @SuppressWarnings("unchecked")
    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)
  4. android/guava/src/com/google/common/collect/ImmutableSet.java

       * Collections#singleton} for code consistency, {@code null} rejection, and because the return
       * type conveys the immutability guarantee.
       */
      public static <E> ImmutableSet<E> of(E element) {
        return new SingletonImmutableSet<>(element);
      }
    
      /**
       * Returns an immutable set containing the given elements, minus duplicates, in the order each was
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/ImmutableSetTest.java

        return ImmutableSet.copyOf(elements);
      }
    
      public void testCreation_allDuplicates() {
        ImmutableSet<String> set = ImmutableSet.copyOf(Lists.newArrayList("a", "a"));
        assertTrue(set instanceof SingletonImmutableSet);
        assertEquals(Lists.newArrayList("a"), Lists.newArrayList(set));
      }
    
      public void testCreation_oneDuplicate() {
        // now we'll get the varargs overload
        ImmutableSet<String> set =
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 13.7K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/ImmutableSetTest.java

        return ImmutableSet.copyOf(elements);
      }
    
      public void testCreation_allDuplicates() {
        ImmutableSet<String> set = ImmutableSet.copyOf(Lists.newArrayList("a", "a"));
        assertTrue(set instanceof SingletonImmutableSet);
        assertEquals(Lists.newArrayList("a"), Lists.newArrayList(set));
      }
    
      public void testCreation_oneDuplicate() {
        // now we'll get the varargs overload
        ImmutableSet<String> set =
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 13.9K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/ImmutableSet.java

       * Collections#singleton} for code consistency, {@code null} rejection, and because the return
       * type conveys the immutability guarantee.
       */
      public static <E> ImmutableSet<E> of(E element) {
        return new SingletonImmutableSet<>(element);
      }
    
      /*
       * TODO: b/315526394 - Skip the Builder entirely for the of(...) methods, since we don't need to
       * worry that we might trigger the fallback to the JDK-backed implementation? (The varargs one
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 35.4K bytes
    - Viewed (0)
Back to top