Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for newStrongInterner (0.11 sec)

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

        String canonical = "a";
        String not = new String("a");
    
        Interner<String> pool = Interners.newStrongInterner();
        assertSame(canonical, pool.intern(canonical));
        assertSame(canonical, pool.intern(not));
      }
    
      public void testStrong_null() {
        Interner<String> pool = Interners.newStrongInterner();
        assertThrows(NullPointerException.class, () -> pool.intern(null));
      }
    
      public void testStrong_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 static <E> Interner<E> newStrongInterner() {
        return newBuilder().strong().build();
      }
    
      /**
       * Returns a new thread-safe interner which retains a weak reference to each instance it has
       * interned, and so does not prevent these instances from being garbage-collected. This most
       * likely does not perform as well as {@link #newStrongInterner}, but is the best alternative when
    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.newStrongInterner();
        assertSame(canonical, pool.intern(canonical));
        assertSame(canonical, pool.intern(not));
      }
    
      public void testStrong_null() {
        Interner<String> pool = Interners.newStrongInterner();
        assertThrows(NullPointerException.class, () -> pool.intern(null));
      }
    
      public void testStrong_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. guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java

          String unused = interner.intern(Double.toHexString(Math.random()));
        }
        return reps;
      }
    
      @Benchmark
      int strongInterner(int reps) {
        Interner<String> interner = Interners.newStrongInterner();
        for (int i = 0; i < reps; i++) {
          String unused = interner.intern(Double.toHexString(Math.random()));
        }
        return reps;
      }
    
      @Benchmark
      int stringIntern(int reps) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Mar 04 04:06:35 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/Interners.java

       */
      public static <E> Interner<E> newStrongInterner() {
        return newBuilder().strong().build();
      }
    
      /**
       * Returns a new thread-safe interner which retains a weak reference to each instance it has
       * interned, and so does not prevent these instances from being garbage-collected. This most
       * likely does not perform as well as {@link #newStrongInterner}, but is the best alternative when
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 13 14:30:51 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  6. android/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java

          String unused = interner.intern(Double.toHexString(Math.random()));
        }
        return reps;
      }
    
      @Benchmark
      int strongInterner(int reps) {
        Interner<String> interner = Interners.newStrongInterner();
        for (int i = 0; i < reps; i++) {
          String unused = interner.intern(Double.toHexString(Math.random()));
        }
        return reps;
      }
    
      @Benchmark
      int stringIntern(int reps) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Mar 04 04:06:35 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/BenchmarkHelpers.java

            }
            return interner;
          }
        },
        StrongInternerImpl {
          @Override
          public <E> Interner<E> create(Collection<E> contents) {
            Interner<E> interner = Interners.newStrongInterner();
            for (E e : contents) {
              E unused = interner.intern(e);
            }
            return interner;
          }
        };
      }
    
      public enum Value {
        INSTANCE;
      }
    
    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

            }
            return interner;
          }
        },
        StrongInternerImpl {
          @Override
          public <E> Interner<E> create(Collection<E> contents) {
            Interner<E> interner = Interners.newStrongInterner();
            for (E e : contents) {
              E unused = interner.intern(e);
            }
            return interner;
          }
        };
      }
    
      public enum Value {
        INSTANCE;
      }
    
    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