Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for intern (0.17 sec)

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

       * intern(a)} is permitted to return one instance now and a different instance later if the
       * original interned instance was garbage-collected.
       *
       * <p><b>Warning:</b> do not use with mutable objects.
       *
       * @throws NullPointerException if {@code sample} is null
       */
      E intern(E sample);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Mar 13 14:30:51 GMT 2023
    - 2K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/Interner.java

       * intern(a)} is permitted to return one instance now and a different instance later if the
       * original interned instance was garbage-collected.
       *
       * <p><b>Warning:</b> do not use with mutable objects.
       *
       * @throws NullPointerException if {@code sample} is null
       */
      E intern(E sample);
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Mar 13 14:30:51 GMT 2023
    - 2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/InternersTest.java

        assertSame(canonical, pool.intern(not));
      }
    
      public void testWeak_null() {
        Interner<String> pool = Interners.newWeakInterner();
        assertThrows(NullPointerException.class, () -> pool.intern(null));
      }
    
      public void testWeak_builder() {
        int concurrencyLevel = 42;
        Interner<Object> interner =
            Interners.newBuilder().weak().concurrencyLevel(concurrencyLevel).build();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java

    public class InternersBenchmark {
      @Benchmark
      int weakInterner(int reps) {
        Interner<String> interner = Interners.newWeakInterner();
        for (int i = 0; i < reps; i++) {
          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++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Mar 04 04:06:35 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/InternersTest.java

        assertSame(canonical, pool.intern(not));
      }
    
      public void testWeak_null() {
        Interner<String> pool = Interners.newWeakInterner();
        assertThrows(NullPointerException.class, () -> pool.intern(null));
      }
    
      public void testWeak_builder() {
        int concurrencyLevel = 42;
        Interner<Object> interner =
            Interners.newBuilder().weak().concurrencyLevel(concurrencyLevel).build();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java

    public class InternersBenchmark {
      @Benchmark
      int weakInterner(int reps) {
        Interner<String> interner = Interners.newWeakInterner();
        for (int i = 0; i < reps; i++) {
          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++) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Mar 04 04:06:35 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/Interners.java

      /**
       * Returns a function that delegates to the {@link Interner#intern} method of the given interner.
       *
       * @since 8.0
       */
      public static <E> Function<E, E> asFunction(Interner<E> interner) {
        return new InternerFunction<>(checkNotNull(interner));
      }
    
      private static class InternerFunction<E> implements Function<E, E> {
    
        private final Interner<E> interner;
    
        public InternerFunction(Interner<E> interner) {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Mar 13 14:30:51 GMT 2023
    - 5.9K bytes
    - Viewed (1)
  8. android/guava/src/com/google/common/collect/Interners.java

      /**
       * Returns a function that delegates to the {@link Interner#intern} method of the given interner.
       *
       * @since 8.0
       */
      public static <E> Function<E, E> asFunction(Interner<E> interner) {
        return new InternerFunction<>(checkNotNull(interner));
      }
    
      private static class InternerFunction<E> implements Function<E, E> {
    
        private final Interner<E> interner;
    
        public InternerFunction(Interner<E> interner) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Mar 13 14:30:51 GMT 2023
    - 5.9K bytes
    - Viewed (0)
  9. guava/src/com/google/common/base/Internal.java

    import java.time.Duration;
    
    /** This class is for {@code com.google.common.base} use only! */
    @J2ktIncompatible
    @GwtIncompatible // java.time.Duration
    @ElementTypesAreNonnullByDefault
    final class Internal {
    
      /**
       * Returns the number of nanoseconds of the given duration without throwing or overflowing.
       *
       * <p>Instead of throwing {@link ArithmeticException}, this method silently saturates to either
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Jan 11 14:30:06 GMT 2024
    - 2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/base/Internal.java

    import java.time.Duration;
    
    /** This class is for {@code com.google.common.base} use only! */
    @J2ktIncompatible
    @GwtIncompatible // java.time.Duration
    @ElementTypesAreNonnullByDefault
    final class Internal {
    
      /**
       * Returns the number of nanoseconds of the given duration without throwing or overflowing.
       *
       * <p>Instead of throwing {@link ArithmeticException}, this method silently saturates to either
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Jan 11 14:30:06 GMT 2024
    - 2K bytes
    - Viewed (0)
Back to top