Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for newWeakInterner (0.14 sec)

  1. android/guava-tests/test/com/google/common/collect/InternersTest.java

        String canonical = "a";
        String not = new String("a");
    
        Interner<String> pool = Interners.newWeakInterner();
        assertSame(canonical, pool.intern(canonical));
        assertSame(canonical, pool.intern(not));
      }
    
      public void testWeak_null() {
        Interner<String> pool = Interners.newWeakInterner();
        assertThrows(NullPointerException.class, () -> pool.intern(null));
      }
    
      public void testWeak_builder() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 22:09:38 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/Interners.java

         */
        public InternerBuilder strong() {
          this.strong = true;
          return this;
        }
    
        /**
         * Instructs the {@link InternerBuilder} to build a weak interner.
         *
         * @see Interners#newWeakInterner()
         */
        @GwtIncompatible("java.lang.ref.WeakReference")
        public InternerBuilder weak() {
          this.strong = false;
          return this;
        }
    
        /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/InternersTest.java

        String canonical = "a";
        String not = new String("a");
    
        Interner<String> pool = Interners.newWeakInterner();
        assertSame(canonical, pool.intern(canonical));
        assertSame(canonical, pool.intern(not));
      }
    
      public void testWeak_null() {
        Interner<String> pool = Interners.newWeakInterner();
        assertThrows(NullPointerException.class, () -> pool.intern(null));
      }
    
      public void testWeak_builder() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 22:09:38 UTC 2024
    - 4K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/Interners.java

         */
        public InternerBuilder strong() {
          this.strong = true;
          return this;
        }
    
        /**
         * Instructs the {@link InternerBuilder} to build a weak interner.
         *
         * @see Interners#newWeakInterner()
         */
        @GwtIncompatible("java.lang.ref.WeakReference")
        public InternerBuilder weak() {
          this.strong = false;
          return this;
        }
    
        /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/Interner.java

     * are available from the {@link Interners} class.
     *
     * <p>Note that {@code String.intern()} has some well-known performance limitations, and should
     * generally be avoided. Prefer {@link Interners#newWeakInterner} or another {@code Interner}
     * implementation even for {@code String} interning.
     *
     * @author Kevin Bourrillion
     * @since 3.0
     */
    @DoNotMock("Use Interners.new*Interner")
    @J2ktIncompatible
    @GwtIncompatible
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 2K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/Interner.java

     * are available from the {@link Interners} class.
     *
     * <p>Note that {@code String.intern()} has some well-known performance limitations, and should
     * generally be avoided. Prefer {@link Interners#newWeakInterner} or another {@code Interner}
     * implementation even for {@code String} interning.
     *
     * @author Kevin Bourrillion
     * @since 3.0
     */
    @DoNotMock("Use Interners.new*Interner")
    @J2ktIncompatible
    @GwtIncompatible
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 2K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/BenchmarkHelpers.java

      }
    
      public enum InternerImpl implements InternerImplEnum {
        WeakInternerImpl {
          @Override
          public <E> Interner<E> create(Collection<E> contents) {
            Interner<E> interner = Interners.newWeakInterner();
            for (E e : contents) {
              E unused = interner.intern(e);
            }
            return interner;
          }
        },
        StrongInternerImpl {
          @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.4K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java

      }
    
      public enum InternerImpl implements InternerImplEnum {
        WeakInternerImpl {
          @Override
          public <E> Interner<E> create(Collection<E> contents) {
            Interner<E> interner = Interners.newWeakInterner();
            for (E e : contents) {
              E unused = interner.intern(e);
            }
            return interner;
          }
        },
        StrongInternerImpl {
          @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.4K bytes
    - Viewed (0)
Back to top