Home
last modified time | relevance | path

Searched refs:bimap (Results 1 – 25 of 37) sorted by relevance

12

/external/guava/guava-tests/test/com/google/common/collect/
DAbstractBiMapTest.java32 BiMap<Integer, String> bimap = in testIdentityKeySetIteratorRemove() local
35 bimap.put(1, "one"); in testIdentityKeySetIteratorRemove()
36 bimap.put(2, "two"); in testIdentityKeySetIteratorRemove()
37 bimap.put(3, "three"); in testIdentityKeySetIteratorRemove()
38 Iterator<Integer> iterator = bimap.keySet().iterator(); in testIdentityKeySetIteratorRemove()
44 assertEquals(1, bimap.size()); in testIdentityKeySetIteratorRemove()
45 assertEquals(1, bimap.inverse().size()); in testIdentityKeySetIteratorRemove()
49 BiMap<Integer, String> bimap = in testIdentityEntrySetIteratorRemove() local
52 bimap.put(1, "one"); in testIdentityEntrySetIteratorRemove()
53 bimap.put(2, "two"); in testIdentityEntrySetIteratorRemove()
[all …]
DEnumBiMapTest.java130 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(Currency.class, Country.class); in testCreate() local
131 assertTrue(bimap.isEmpty()); in testCreate()
132 assertEquals("{}", bimap.toString()); in testCreate()
133 assertEquals(HashBiMap.create(), bimap); in testCreate() local
134 bimap.put(Currency.DOLLAR, Country.CANADA); in testCreate()
135 assertEquals(Country.CANADA, bimap.get(Currency.DOLLAR)); in testCreate()
136 assertEquals(Currency.DOLLAR, bimap.inverse().get(Country.CANADA)); in testCreate()
146 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(map); in testCreateFromMap() local
147 assertEquals(Country.CANADA, bimap.get(Currency.DOLLAR)); in testCreateFromMap()
148 assertEquals(Currency.DOLLAR, bimap.inverse().get(Country.CANADA)); in testCreateFromMap()
[all …]
DEnumHashBiMapTest.java124 EnumHashBiMap<Currency, String> bimap = EnumHashBiMap.create(Currency.class); in testCreate() local
125 assertTrue(bimap.isEmpty()); in testCreate()
126 assertEquals("{}", bimap.toString()); in testCreate()
127 assertEquals(HashBiMap.create(), bimap); in testCreate() local
128 bimap.put(Currency.DOLLAR, "dollar"); in testCreate()
129 assertEquals("dollar", bimap.get(Currency.DOLLAR)); in testCreate()
130 assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar")); in testCreate()
140 EnumHashBiMap<Currency, String> bimap = EnumHashBiMap.create(map); in testCreateFromMap() local
141 assertEquals("dollar", bimap.get(Currency.DOLLAR)); in testCreateFromMap()
142 assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar")); in testCreateFromMap()
[all …]
DHashBiMapTest.java82 HashBiMap<String, String> bimap = HashBiMap.create(map); in testMapConstructor() local
83 assertEquals("dollar", bimap.get("canada")); in testMapConstructor()
84 assertEquals("canada", bimap.inverse().get("dollar")); in testMapConstructor()
90 BiMap<Integer, Integer> bimap = HashBiMap.create(N); in testBashIt() local
91 BiMap<Integer, Integer> inverse = bimap.inverse(); in testBashIt()
94 assertNull(bimap.put(2 * i, 2 * i + 1)); in testBashIt()
97 assertEquals(2 * i + 1, (int) bimap.get(2 * i)); in testBashIt()
103 int oldValue = bimap.get(2 * i); in testBashIt()
104 assertEquals(2 * i + 1, (int) bimap.put(2 * i, oldValue - 2)); in testBashIt()
107 assertEquals(2 * i - 1, (int) bimap.get(2 * i)); in testBashIt()
[all …]
DImmutableBiMapTest.java144 BiMap<K, V> bimap = (BiMap<K, V>) map; in assertMoreInvariants() local
148 assertEquals(entry.getKey(), bimap.inverse().get(entry.getValue())); in assertMoreInvariants()
494 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.of(); in testEmpty() local
495 assertEquals(Collections.<String, Integer>emptyMap(), bimap); in testEmpty() local
496 assertEquals(Collections.<String, Integer>emptyMap(), bimap.inverse()); in testEmpty()
503 ImmutableBiMap<String, Integer> bimap = in testFromHashMap() local
505 assertMapEquals(bimap, "one", 1, "two", 2); in testFromHashMap()
506 assertMapEquals(bimap.inverse(), 1, "one", 2, "two"); in testFromHashMap()
510 ImmutableBiMap<String, Integer> bimap = in testFromImmutableMap() local
519 assertMapEquals(bimap, "one", 1, "two", 2, "three", 3, "four", 4, "five", 5); in testFromImmutableMap()
[all …]
DSynchronizedBiMapTest.java146 BiMap<String, Integer> bimap = create(); in testInverse() local
147 BiMap<Integer, String> inverse = bimap.inverse(); in testInverse()
148 assertSame(bimap, inverse.inverse()); in testInverse()
DMapsCollectionTest.java85 BiMap<String, String> bimap = HashBiMap.create(entries.length); in suite()
87 checkArgument(!bimap.containsKey(entry.getKey())); in suite()
88 bimap.put(entry.getKey(), entry.getValue()); in suite()
90 return Maps.unmodifiableBiMap(bimap); in suite()
/external/guava/android/guava-tests/test/com/google/common/collect/
DAbstractBiMapTest.java32 BiMap<Integer, String> bimap = in testIdentityKeySetIteratorRemove() local
35 bimap.put(1, "one"); in testIdentityKeySetIteratorRemove()
36 bimap.put(2, "two"); in testIdentityKeySetIteratorRemove()
37 bimap.put(3, "three"); in testIdentityKeySetIteratorRemove()
38 Iterator<Integer> iterator = bimap.keySet().iterator(); in testIdentityKeySetIteratorRemove()
44 assertEquals(1, bimap.size()); in testIdentityKeySetIteratorRemove()
45 assertEquals(1, bimap.inverse().size()); in testIdentityKeySetIteratorRemove()
49 BiMap<Integer, String> bimap = in testIdentityEntrySetIteratorRemove() local
52 bimap.put(1, "one"); in testIdentityEntrySetIteratorRemove()
53 bimap.put(2, "two"); in testIdentityEntrySetIteratorRemove()
[all …]
DEnumBiMapTest.java130 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(Currency.class, Country.class); in testCreate() local
131 assertTrue(bimap.isEmpty()); in testCreate()
132 assertEquals("{}", bimap.toString()); in testCreate()
133 assertEquals(HashBiMap.create(), bimap); in testCreate() local
134 bimap.put(Currency.DOLLAR, Country.CANADA); in testCreate()
135 assertEquals(Country.CANADA, bimap.get(Currency.DOLLAR)); in testCreate()
136 assertEquals(Currency.DOLLAR, bimap.inverse().get(Country.CANADA)); in testCreate()
146 EnumBiMap<Currency, Country> bimap = EnumBiMap.create(map); in testCreateFromMap() local
147 assertEquals(Country.CANADA, bimap.get(Currency.DOLLAR)); in testCreateFromMap()
148 assertEquals(Currency.DOLLAR, bimap.inverse().get(Country.CANADA)); in testCreateFromMap()
[all …]
DEnumHashBiMapTest.java124 EnumHashBiMap<Currency, String> bimap = EnumHashBiMap.create(Currency.class); in testCreate() local
125 assertTrue(bimap.isEmpty()); in testCreate()
126 assertEquals("{}", bimap.toString()); in testCreate()
127 assertEquals(HashBiMap.create(), bimap); in testCreate() local
128 bimap.put(Currency.DOLLAR, "dollar"); in testCreate()
129 assertEquals("dollar", bimap.get(Currency.DOLLAR)); in testCreate()
130 assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar")); in testCreate()
140 EnumHashBiMap<Currency, String> bimap = EnumHashBiMap.create(map); in testCreateFromMap() local
141 assertEquals("dollar", bimap.get(Currency.DOLLAR)); in testCreateFromMap()
142 assertEquals(Currency.DOLLAR, bimap.inverse().get("dollar")); in testCreateFromMap()
[all …]
DImmutableBiMapTest.java114 BiMap<K, V> bimap = (BiMap<K, V>) map; in assertMoreInvariants() local
118 assertEquals(entry.getKey(), bimap.inverse().get(entry.getValue())); in assertMoreInvariants()
464 ImmutableBiMap<String, Integer> bimap = ImmutableBiMap.of(); in testEmpty() local
465 assertEquals(Collections.<String, Integer>emptyMap(), bimap); in testEmpty() local
466 assertEquals(Collections.<String, Integer>emptyMap(), bimap.inverse()); in testEmpty()
473 ImmutableBiMap<String, Integer> bimap = in testFromHashMap() local
475 assertMapEquals(bimap, "one", 1, "two", 2); in testFromHashMap()
476 assertMapEquals(bimap.inverse(), 1, "one", 2, "two"); in testFromHashMap()
480 ImmutableBiMap<String, Integer> bimap = in testFromImmutableMap() local
489 assertMapEquals(bimap, "one", 1, "two", 2, "three", 3, "four", 4, "five", 5); in testFromImmutableMap()
[all …]
DHashBiMapTest.java82 HashBiMap<String, String> bimap = HashBiMap.create(map); in testMapConstructor() local
83 assertEquals("dollar", bimap.get("canada")); in testMapConstructor()
84 assertEquals("canada", bimap.inverse().get("dollar")); in testMapConstructor()
90 BiMap<Integer, Integer> bimap = HashBiMap.create(N); in testBashIt() local
91 BiMap<Integer, Integer> inverse = bimap.inverse(); in testBashIt()
94 assertNull(bimap.put(2 * i, 2 * i + 1)); in testBashIt()
97 assertEquals(2 * i + 1, (int) bimap.get(2 * i)); in testBashIt()
103 int oldValue = bimap.get(2 * i); in testBashIt()
104 assertEquals(2 * i + 1, (int) bimap.put(2 * i, oldValue - 2)); in testBashIt()
107 assertEquals(2 * i - 1, (int) bimap.get(2 * i)); in testBashIt()
[all …]
DSynchronizedBiMapTest.java139 BiMap<String, Integer> bimap = create(); in testInverse() local
140 BiMap<Integer, String> inverse = bimap.inverse(); in testInverse()
141 assertSame(bimap, inverse.inverse()); in testInverse()
DMapsCollectionTest.java85 BiMap<String, String> bimap = HashBiMap.create(entries.length); in suite()
87 checkArgument(!bimap.containsKey(entry.getKey())); in suite()
88 bimap.put(entry.getKey(), entry.getValue()); in suite()
90 return Maps.unmodifiableBiMap(bimap); in suite()
/external/guava/android/guava/src/com/google/common/collect/
DImmutableBiMap.java280 ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map; in copyOf() local
283 if (!bimap.isPartialView()) { in copyOf()
284 return bimap; in copyOf()
355 SerializedForm(ImmutableBiMap<?, ?> bimap) { in SerializedForm() argument
356 super(bimap); in SerializedForm()
DEnumHashBiMap.java67 EnumHashBiMap<K, V> bimap = create(EnumBiMap.inferKeyType(map)); in create() local
68 bimap.putAll(map); in create()
69 return bimap; in create()
DEnumBiMap.java66 EnumBiMap<K, V> bimap = create(inferKeyType(map), inferValueType(map)); in create() local
67 bimap.putAll(map); in create()
68 return bimap; in create()
DMaps.java1368 public static <A, B> Converter<A, B> asConverter(final BiMap<A, B> bimap) {
1369 return new BiMapConverter<>(bimap);
1373 private final BiMap<A, B> bimap;
1375 BiMapConverter(BiMap<A, B> bimap) {
1376 this.bimap = checkNotNull(bimap);
1381 return convert(bimap, a);
1386 return convert(bimap.inverse(), b);
1389 private static <X, Y> Y convert(BiMap<X, Y> bimap, X input) {
1390 Y output = bimap.get(input);
1399 return this.bimap.equals(that.bimap);
[all …]
/external/guava/guava/src/com/google/common/collect/
DEnumHashBiMap.java67 EnumHashBiMap<K, V> bimap = create(EnumBiMap.inferKeyType(map)); in create() local
68 bimap.putAll(map); in create()
69 return bimap; in create()
DImmutableBiMap.java332 ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map; in copyOf() local
335 if (!bimap.isPartialView()) { in copyOf()
336 return bimap; in copyOf()
417 SerializedForm(ImmutableBiMap<?, ?> bimap) { in SerializedForm() argument
418 super(bimap); in SerializedForm()
DEnumBiMap.java66 EnumBiMap<K, V> bimap = create(inferKeyType(map), inferValueType(map)); in create() local
67 bimap.putAll(map); in create()
68 return bimap; in create()
DHashBiMap.java82 HashBiMap<K, V> bimap = create(map.size()); in create() local
83 bimap.putAll(map); in create()
84 return bimap; in create()
723 private final HashBiMap<K, V> bimap;
725 InverseSerializedForm(HashBiMap<K, V> bimap) {
726 this.bimap = bimap;
730 return bimap.inverse();
DMaps.java1494 public static <A, B> Converter<A, B> asConverter(final BiMap<A, B> bimap) {
1495 return new BiMapConverter<>(bimap);
1499 private final BiMap<A, B> bimap;
1501 BiMapConverter(BiMap<A, B> bimap) {
1502 this.bimap = checkNotNull(bimap);
1507 return convert(bimap, a);
1512 return convert(bimap.inverse(), b);
1515 private static <X, Y> Y convert(BiMap<X, Y> bimap, X input) {
1516 Y output = bimap.get(input);
1525 return this.bimap.equals(that.bimap);
[all …]
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DImmutableBiMap.java134 ImmutableBiMap<K, V> bimap = (ImmutableBiMap<K, V>) map; in copyOf() local
135 return bimap; in copyOf()
/external/mesa3d/src/gallium/drivers/nouveau/codegen/
Dnv50_ir_util.h772 struct bimap struct
778 bimap() : l(back), r(forth) { } in bimap() argument
779 bimap(const bimap<S, T> &m) in bimap() argument

12