Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for SynchronizedBiMap (0.24 sec)

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

        BiMap<String, Integer> bimap = create();
        BiMap<Integer, String> inverse = bimap.inverse();
        assertSame(bimap, inverse.inverse());
        assertTrue(inverse instanceof SynchronizedBiMap);
        assertSame(mutex, ((SynchronizedBiMap<?, ?>) inverse).mutex);
      }
    
      @Override
      public void testValues() {
        BiMap<String, Integer> map = create();
        Set<Integer> values = map.values();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 5.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java

        BiMap<String, Integer> bimap = create();
        BiMap<Integer, String> inverse = bimap.inverse();
        assertSame(bimap, inverse.inverse());
        assertTrue(inverse instanceof SynchronizedBiMap);
        assertSame(mutex, ((SynchronizedBiMap<?, ?>) inverse).mutex);
      }
    
      @Override
      public void testValues() {
        BiMap<String, Integer> map = create();
        Set<Integer> values = map.values();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Synchronized.java

          BiMap<K, V> bimap, @CheckForNull Object mutex) {
        if (bimap instanceof SynchronizedBiMap || bimap instanceof ImmutableBiMap) {
          return bimap;
        }
        return new SynchronizedBiMap<>(bimap, mutex, null);
      }
    
      static final class SynchronizedBiMap<K extends @Nullable Object, V extends @Nullable Object>
          extends SynchronizedMap<K, V> implements BiMap<K, V>, Serializable {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 53.4K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/MapsTest.java

      public void testSynchronizedBiMap() {
        BiMap<String, Integer> bimap = HashBiMap.create();
        bimap.put("one", 1);
        BiMap<String, Integer> sync = Maps.synchronizedBiMap(bimap);
        bimap.put("two", 2);
        sync.put("three", 3);
        assertEquals(ImmutableSet.of(1, 2, 3), bimap.inverse().keySet());
        assertEquals(ImmutableSet.of(1, 2, 3), sync.inverse().keySet());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Mar 04 16:06:01 GMT 2024
    - 67.2K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/MapsTest.java

      public void testSynchronizedBiMap() {
        BiMap<String, Integer> bimap = HashBiMap.create();
        bimap.put("one", 1);
        BiMap<String, Integer> sync = Maps.synchronizedBiMap(bimap);
        bimap.put("two", 2);
        sync.put("three", 3);
        assertEquals(ImmutableSet.of(1, 2, 3), bimap.inverse().keySet());
        assertEquals(ImmutableSet.of(1, 2, 3), sync.inverse().keySet());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Mar 04 16:06:01 GMT 2024
    - 64.3K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Maps.java

       *
       * <p>It is imperative that the user manually synchronize on the returned map when accessing any
       * of its collection views:
       *
       * <pre>{@code
       * BiMap<Long, String> map = Maps.synchronizedBiMap(
       *     HashBiMap.<Long, String>create());
       * ...
       * Set<Long> set = map.keySet();  // Needn't be in synchronized block
       * ...
       * synchronized (map) {  // Synchronizing on map, not set!
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 159.6K bytes
    - Viewed (0)
Back to top