Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 69 for BiMap (0.15 sec)

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

      public void testCreate() {
        EnumHashBiMap<Currency, String> bimap = EnumHashBiMap.create(Currency.class);
        assertTrue(bimap.isEmpty());
        assertEquals("{}", bimap.toString());
        assertEquals(HashBiMap.create(), bimap);
        bimap.put(Currency.DOLLAR, "dollar");
        assertEquals("dollar", bimap.get(Currency.DOLLAR));
        assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar"));
      }
    
      public void testCreateFromMap() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Feb 26 16:35:21 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/collect/testing/google/TestStringBiMapGenerator.java

     * limitations under the License.
     */
    
    package com.google.common.collect.testing.google;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.collect.BiMap;
    import com.google.common.collect.testing.Helpers;
    import com.google.common.collect.testing.SampleElements;
    import java.util.List;
    import java.util.Map.Entry;
    
    /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Feb 26 19:46:10 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/ImmutableBiMap.java

          ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map;
          // TODO(lowasser): if we need to make a copy of a BiMap because the
          // forward map is a view, don't make a copy of the non-view delegate map
          if (!bimap.isPartialView()) {
            return bimap;
          }
        }
        return copyOf(map.entrySet());
      }
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java

    import java.util.Collections;
    import java.util.List;
    import org.junit.Ignore;
    
    /**
     * Tests for the {@code inverse} view of a BiMap.
     *
     * <p>This assumes that {@code bimap.inverse().inverse() == bimap}, which is not technically
     * required but is fulfilled by all current implementations.
     *
     * @author Louis Wasserman
     */
    @GwtCompatible(emulated = true)
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 3K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java

    import java.util.Collections;
    import java.util.List;
    import org.junit.Ignore;
    
    /**
     * Tests for the {@code inverse} view of a BiMap.
     *
     * <p>This assumes that {@code bimap.inverse().inverse() == bimap}, which is not technically
     * required but is fulfilled by all current implementations.
     *
     * @author Louis Wasserman
     */
    @GwtCompatible(emulated = true)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 3K bytes
    - Viewed (0)
  6. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableBiMap.java

        if (map instanceof ImmutableBiMap) {
          @SuppressWarnings("unchecked") // safe since map is not writable
          ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map;
          return bimap;
        }
    
        if (map.isEmpty()) {
          return of();
        }
    
        ImmutableMap<K, V> immutableMap = ImmutableMap.copyOf(map);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 23 18:43:40 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/Synchronized.java

      }
    
      static <K extends @Nullable Object, V extends @Nullable Object> BiMap<K, V> biMap(
          BiMap<K, V> bimap, @CheckForNull Object mutex) {
        if (bimap instanceof SynchronizedBiMap || bimap instanceof ImmutableBiMap) {
          return bimap;
        }
        return new SynchronizedBiMap<>(bimap, mutex, null);
      }
    
    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)
  8. guava/src/com/google/common/collect/EnumBiMap.java

    import java.util.EnumMap;
    import java.util.Map;
    
    /**
     * A {@code BiMap} backed by two {@code EnumMap} instances. Null keys and values are not permitted.
     * An {@code EnumBiMap} and its inverse are both serializable.
     *
     * <p>See the Guava User Guide article on <a href=
     * "https://github.com/google/guava/wiki/NewCollectionTypesExplained#bimap">{@code BiMap}</a>.
     *
     * @author Mike Bostock
     * @since 2.0
     */
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Aug 24 01:40:03 GMT 2023
    - 6.3K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/ImmutableBiMapFloodingTest.java

                .collect(ImmutableList.toImmutableList()),
            n -> n * Math.log(n),
            ImmutableList.of(
                QueryOp.create("BiMap.get", BiMap::get, Math::log),
                QueryOp.create("BiMap.inverse.get", (bm, o) -> bm.inverse().get(o), Math::log)));
      }
    
      /** All the ways to create an ImmutableBiMap. */
      enum ConstructionPathway {
        COPY_OF_MAP {
          @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 21:01:39 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java

      @Override
      protected final void assertMoreInvariants(Map<K, V> map) {
        BiMap<K, V> bimap = (BiMap<K, V>) map;
    
        for (Entry<K, V> entry : map.entrySet()) {
          assertEquals(entry.getKey() + "=" + entry.getValue(), entry.toString());
          assertEquals(entry.getKey(), bimap.inverse().get(entry.getValue()));
        }
    
        assertEquals("{" + JOINER.join(map.entrySet()) + "}", map.toString());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Mar 09 16:16:28 GMT 2022
    - 1.9K bytes
    - Viewed (0)
Back to top