Пример #1
0
 public K get(Object obj) {
   if (obj == null) {
     return null;
   }
   for (BiMapEntry biMapEntry =
           this.f2450a.f2455b[C1856m.m4276a(obj.hashCode()) & this.f2450a.f2457d];
       biMapEntry != null;
       biMapEntry = biMapEntry.m4165b()) {
     if (obj.equals(biMapEntry.getValue())) {
       return biMapEntry.getKey();
     }
   }
   return null;
 }
Пример #2
0
 RegularImmutableBiMap(Collection<? extends Entry<? extends K, ? extends V>> collection) {
   int size = collection.size();
   int a = C1856m.m4277a(size, 1.2d);
   this.f2457d = a - 1;
   BiMapEntry[] a2 = m4176a(a);
   BiMapEntry[] a3 = m4176a(a);
   BiMapEntry[] a4 = m4176a(size);
   int i = 0;
   a = 0;
   for (Entry entry : collection) {
     BiMapEntry biMapEntry;
     Object a5 = C1650g.m3080a(entry.getKey());
     Object a6 = C1650g.m3080a(entry.getValue());
     int hashCode = a5.hashCode();
     int hashCode2 = a6.hashCode();
     int a7 = C1856m.m4276a(hashCode) & this.f2457d;
     int a8 = C1856m.m4276a(hashCode2) & this.f2457d;
     BiMapEntry biMapEntry2 = a2[a7];
     for (biMapEntry = biMapEntry2; biMapEntry != null; biMapEntry = biMapEntry.m4164a()) {
       if (a5.equals(biMapEntry.getKey())) {
         throw new IllegalArgumentException(
             "Multiple entries with same key: " + entry + " and " + biMapEntry);
       }
     }
     BiMapEntry biMapEntry3 = a3[a8];
     for (biMapEntry = biMapEntry3; biMapEntry != null; biMapEntry = biMapEntry.m4165b()) {
       if (a6.equals(biMapEntry.getValue())) {
         throw new IllegalArgumentException(
             "Multiple entries with same value: " + entry + " and " + biMapEntry);
       }
     }
     BiMapEntry biMapEntry4 =
         (biMapEntry2 == null && biMapEntry3 == null)
             ? new BiMapEntry(a5, a6)
             : new NonTerminalBiMapEntry(a5, a6, biMapEntry2, biMapEntry3);
     a2[a7] = biMapEntry4;
     a3[a8] = biMapEntry4;
     int i2 = i + 1;
     a4[i] = biMapEntry4;
     a = (hashCode ^ hashCode2) + a;
     i = i2;
   }
   this.f2454a = a2;
   this.f2455b = a3;
   this.f2456c = a4;
   this.f2458e = a;
 }