/external/guava/guava-tests/test/com/google/common/collect/ |
AbstractBiMapTest.java | 35 * Common tests for any {@code BiMap}. 42 protected abstract BiMap<Integer, String> create(); 44 protected BiMap<Integer, String> bimap; field in class:AbstractBiMapTest 50 bimap = create(); 51 entrySet = bimap.entrySet(); 55 bimap.clear(); 56 assertTrue(bimap.isEmpty()); 58 bimap.clear(); 59 assertTrue(bimap.isEmpty()) [all...] |
HashBiMapTest.java | 35 @Override protected BiMap<Integer, String> create() { 40 BiMap<String, String> bimap = HashBiMap.create(); local 41 assertEquals(0, bimap.size()); 42 bimap.put("canada", "dollar"); 43 assertEquals("dollar", bimap.get("canada")); 44 assertEquals("canada", bimap.inverse().get("dollar")); 53 HashBiMap<String, String> bimap = HashBiMap.create(map); local 54 assertEquals("dollar", bimap.get("canada")); 55 assertEquals("canada", bimap.inverse().get("dollar")) 61 BiMap<Integer, Integer> bimap = HashBiMap.create(N); local [all...] |
SynchronizedBiMapTest.java | 27 * Tests for {@code Synchronized#biMap}. 39 @Override protected <K, V> BiMap<K, V> create() { 42 BiMap<K, V> outer = Synchronized.biMap(inner, mutex); 46 static class TestBiMap<K, V> extends TestMap<K, V> implements BiMap<K, V> { 47 private final BiMap<K, V> delegate; 49 public TestBiMap(BiMap<K, V> delegate, Object mutex) { 61 public BiMap<V, K> inverse() { 79 BiMap<String, Integer> bimap = create() local [all...] |
EnumBiMapTest.java | 43 EnumBiMap<Currency, Country> bimap = local 45 assertTrue(bimap.isEmpty()); 46 assertEquals("{}", bimap.toString()); 47 assertEquals(HashBiMap.create(), bimap); local 48 bimap.put(Currency.DOLLAR, Country.CANADA); 49 assertEquals(Country.CANADA, bimap.get(Currency.DOLLAR)); 50 assertEquals(Currency.DOLLAR, bimap.inverse().get(Country.CANADA)); 59 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(map); local 60 assertEquals(Country.CANADA, bimap.get(Currency.DOLLAR)); 61 assertEquals(Currency.DOLLAR, bimap.inverse().get(Country.CANADA)) 104 EnumBiMap<Currency, Country> bimap = local 110 EnumBiMap<Currency, Country> bimap = local 121 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(map); local 135 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(map); local 156 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(map); local [all...] |
EnumHashBiMapTest.java | 40 EnumHashBiMap<Currency, String> bimap = local 42 assertTrue(bimap.isEmpty()); 43 assertEquals("{}", bimap.toString()); 44 assertEquals(HashBiMap.create(), bimap); local 45 bimap.put(Currency.DOLLAR, "dollar"); 46 assertEquals("dollar", bimap.get(Currency.DOLLAR)); 47 assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar")); 56 EnumHashBiMap<Currency, String> bimap local 58 assertEquals("dollar", bimap.get(Currency.DOLLAR)); 59 assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar")) 126 EnumHashBiMap<Currency, String> bimap = local 137 EnumHashBiMap<Currency, String> bimap local 146 EnumHashBiMap<Currency, String> bimap = local 164 EnumHashBiMap<Currency, String> bimap local [all...] |
BiMapMapInterfaceTest.java | 62 BiMap<String, Integer> bimap = (BiMap<String, Integer>) map; local 63 BiMap<Integer, String> inverse = bimap.inverse(); 64 assertEquals(bimap.size(), inverse.size()); 65 for (Entry<String, Integer> entry : bimap.entrySet()) { 69 assertEquals(entry.getKey(), bimap.get(entry.getValue())); 102 BiMap<String, Integer> bimap = HashBiMap.create() local [all...] |
InverseBiMapTest.java | 22 * Unit test covering the inverse view of a {@code BiMap}. 28 @Override protected BiMap<Integer, String> create() { 29 BiMap<String, Integer> inverse = HashBiMap.create();
|
BiMapCollectionTest.java | 43 BiMap<String, Integer> bimap = HashBiMap.create(); 45 bimap.put(elements[i], i); 47 return bimap.keySet(); 58 BiMap<Integer, String> bimap = HashBiMap.create(); 60 bimap.put(i, elements[i]); 62 return bimap.values();
|
ImmutableBiMapTest.java | 157 BiMap<K, V> bimap = (BiMap<K, V>) map; local 162 assertEquals(entry.getKey(), bimap.inverse().get(entry.getValue())); 441 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.of(); local 442 assertEquals(Collections.<String, Integer>emptyMap(), bimap); local 443 assertEquals(Collections.<String, Integer>emptyMap(), bimap.inverse()); 450 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 452 assertMapEquals(bimap, "one", 1, "two", 2); 453 assertMapEquals(bimap.inverse(), 1, "one", 2, "two") 457 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 492 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 501 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 509 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 517 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 524 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.of(); local 530 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local 541 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.copyOf( local [all...] |
ConstrainedBiMapTest.java | 51 @Override protected BiMap<Integer, String> create() {
|
/external/guava/guava/src/com/google/common/collect/ |
BiMap.java | 27 * A bimap (or "bidirectional map") is a map that preserves the uniqueness of 29 * support an "inverse view", which is another bimap containing the same entries 30 * as this bimap but with reversed keys and values. 36 public interface BiMap<K, V> extends Map<K, V> { 43 * different key in this bimap. The bimap will remain unmodified in this 52 * operation. If the bimap previously contained the provided key-value 56 * bimap to increase by one, stay the same, or even decrease by one. 78 * bimap before the exception was thrown. 88 * <p>Because a bimap has unique values, this method returns a {@link Set} [all...] |
ImmutableBiMap.java | 26 * An immutable {@link BiMap} with reliable user-specified iteration order. Does 33 * make a "defensive copy" of a bimap provided to your class by a caller. 44 implements BiMap<K, V> { 50 * Returns the empty bimap. 59 * Returns an immutable bimap containing a single entry. 118 * A builder for creating immutable bimap instances, especially {@code public 132 * multiple times to build multiple bimaps in series. Each bimap is a superset 146 * Associates {@code key} with {@code value} in the built bimap. Duplicate 155 * Associates all of the given map's keys and values in the built bimap. 167 * Returns a newly-created immutable bimap 197 ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map; local [all...] |
EnumHashBiMap.java | 32 * A {@code BiMap} backed by an {@code EnumMap} instance for keys-to-values, and 56 * Constructs a new bimap with the same mappings as the specified map. If the 58 * bimap has the same key type as the input bimap. Otherwise, the specified 67 EnumHashBiMap<K, V> bimap = create(EnumBiMap.inferKeyType(map)); local 68 bimap.putAll(map); 69 return bimap;
|
HashBiMap.java | 31 * A {@link BiMap} backed by two {@link HashMap} instances. This implementation 50 * Constructs a new, empty bimap with the specified expected size. 61 * Constructs a new bimap containing initial values from {@code map}. The 62 * bimap is created with an initial capacity sufficient to hold the mappings 67 HashBiMap<K, V> bimap = create(map.size()); local 68 bimap.putAll(map); 69 return bimap;
|
EnumBiMap.java | 31 * A {@code BiMap} backed by two {@code EnumMap} instances. Null keys and values 57 * Returns a new bimap with the same mappings as the specified map. If the 58 * specified map is an {@code EnumBiMap}, the new bimap has the same types as 68 EnumBiMap<K, V> bimap = create(inferKeyType(map), inferValueType(map)); local 69 bimap.putAll(map); 70 return bimap;
|
AbstractBiMap.java | 38 * A general-purpose bimap implementation using any two backing {@code Map} 49 implements BiMap<K, V>, Serializable { 54 /** Package-private constructor for creating a map-backed bimap. */ 59 /** Private constructor for inverse bimap. */ 157 public BiMap<V, K> inverse() { 378 * Serialization stores the forward bimap, the inverse of this inverse. 379 * Deserialization calls inverse() on the forward bimap and returns that 382 * If a bimap and its inverse are serialized together, the deserialized 387 * @serialData the forward bimap
|
MapConstraints.java | 321 * Returns a constrained view of the specified bimap, using the specified 322 * constraint. Any operations that modify the bimap will have the associated 325 * <p>The returned bimap is not serializable. 327 * @param map the bimap to constrain 329 * @return a constrained view of the specified bimap 331 public static <K, V> BiMap<K, V> constrainedBiMap( 332 BiMap<K, V> map, MapConstraint<? super K, ? super V> constraint) { 338 implements BiMap<K, V> { 343 * inverse BiMap could occur after inverse()'s read of the field's initial 351 volatile BiMap<V, K> inverse [all...] |
Synchronized.java | 1098 static <K, V> BiMap<K, V> biMap(BiMap<K, V> bimap, @Nullable Object mutex) { 1099 if (bimap instanceof SynchronizedBiMap || 1100 bimap instanceof ImmutableBiMap) { 1101 return bimap; 1103 return new SynchronizedBiMap<K, V>(bimap, mutex, null); 1107 extends SynchronizedMap<K, V> implements BiMap<K, V>, Serializable { 1109 private transient BiMap<V, K> inverse [all...] |
RegularImmutableBiMap.java | 22 * Bimap with one or more mappings.
|
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ |
HashBiMap.java | 27 * A {@link BiMap} backed by two {@link HashMap} instances. This implementation 46 * Constructs a new, empty bimap with the specified expected size. 57 * Constructs a new bimap containing initial values from {@code map}. The 58 * bimap is created with an initial capacity sufficient to hold the mappings 63 HashBiMap<K, V> bimap = create(map.size()); local 64 bimap.putAll(map); 65 return bimap;
|
EnumHashBiMap.java | 27 * A {@code BiMap} backed by an {@code EnumMap} instance for keys-to-values, and 51 * Constructs a new bimap with the same mappings as the specified map. If the 53 * bimap has the same key type as the input bimap. Otherwise, the specified 62 EnumHashBiMap<K, V> bimap = create(EnumBiMap.inferKeyType(map)); local 63 bimap.putAll(map); 64 return bimap;
|
EnumBiMap.java | 27 * A {@code BiMap} backed by two {@code EnumMap} instances. Null keys and values 53 * Returns a new bimap with the same mappings as the specified map. If the 54 * specified map is an {@code EnumBiMap}, the new bimap has the same types as 64 EnumBiMap<K, V> bimap = create(inferKeyType(map), inferValueType(map)); local 65 bimap.putAll(map); 66 return bimap;
|
ImmutableBiMap.java | 28 implements BiMap<K, V> { 96 ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map; local 97 return bimap;
|
AbstractBiMap.java | 34 * A general-purpose bimap implementation using any two backing {@code Map} 45 implements BiMap<K, V>, Serializable { 50 /** Package-private constructor for creating a map-backed bimap. */ 55 /** Private constructor for inverse bimap. */ 153 public BiMap<V, K> inverse() { 374 * Serialization stores the forward bimap, the inverse of this inverse. 375 * Deserialization calls inverse() on the forward bimap and returns that 378 * If a bimap and its inverse are serialized together, the deserialized
|
Synchronized.java | 1085 static <K, V> BiMap<K, V> biMap(BiMap<K, V> bimap, @Nullable Object mutex) { 1086 if (bimap instanceof SynchronizedBiMap || 1087 bimap instanceof ImmutableBiMap) { 1088 return bimap; 1090 return new SynchronizedBiMap<K, V>(bimap, mutex, null); 1094 extends SynchronizedMap<K, V> implements BiMap<K, V>, Serializable { 1096 private transient BiMap<V, K> inverse [all...] |