/external/guava/android/guava/src/com/google/common/collect/ |
D | RegularImmutableMap.java | 71 @VisibleForTesting final transient @Nullable Object[] alternatingKeysAndValues; field in RegularImmutableMap 91 int n, @Nullable Object[] alternatingKeysAndValues) { in create() argument 92 return create(n, alternatingKeysAndValues, /* builder= */ null); in create() 101 int n, @Nullable Object[] alternatingKeysAndValues, @Nullable Builder<K, V> builder) { in create() argument 109 requireNonNull(alternatingKeysAndValues[0]), requireNonNull(alternatingKeysAndValues[1])); in create() 110 return new RegularImmutableMap<K, V>(null, alternatingKeysAndValues, 1); in create() 112 checkPositionIndex(n, alternatingKeysAndValues.length >> 1); in create() 119 Object hashTablePlus = createHashTable(alternatingKeysAndValues, n, tableSize, 0); in create() 130 alternatingKeysAndValues = Arrays.copyOf(alternatingKeysAndValues, n * 2); in create() 134 return new RegularImmutableMap<K, V>(hashTable, alternatingKeysAndValues, n); in create() [all …]
|
D | RegularImmutableBiMap.java | 36 @VisibleForTesting final transient @Nullable Object[] alternatingKeysAndValues; field in RegularImmutableBiMap 45 this.alternatingKeysAndValues = new Object[0]; in RegularImmutableBiMap() 52 RegularImmutableBiMap(@Nullable Object[] alternatingKeysAndValues, int size) { in RegularImmutableBiMap() argument 53 this.alternatingKeysAndValues = alternatingKeysAndValues; in RegularImmutableBiMap() 58 RegularImmutableMap.createHashTableOrThrow(alternatingKeysAndValues, size, tableSize, 0); in RegularImmutableBiMap() 60 RegularImmutableMap.createHashTableOrThrow(alternatingKeysAndValues, size, tableSize, 1); in RegularImmutableBiMap() 62 new RegularImmutableBiMap<V, K>(valueHashTable, alternatingKeysAndValues, size, this); in RegularImmutableBiMap() 68 @Nullable Object[] alternatingKeysAndValues, in RegularImmutableBiMap() argument 72 this.alternatingKeysAndValues = alternatingKeysAndValues; in RegularImmutableBiMap() 93 RegularImmutableMap.get(keyHashTable, alternatingKeysAndValues, size, keyOffset, key); in get() [all …]
|
D | ImmutableMap.java | 387 @Nullable Object[] alternatingKeysAndValues; field in ImmutableMap.Builder 406 this.alternatingKeysAndValues = new @Nullable Object[2 * initialCapacity]; in Builder() 412 if (minCapacity * 2 > alternatingKeysAndValues.length) { in ensureCapacity() 413 alternatingKeysAndValues = in ensureCapacity() 415 alternatingKeysAndValues, in ensureCapacity() 417 alternatingKeysAndValues.length, minCapacity * 2)); in ensureCapacity() 431 alternatingKeysAndValues[2 * size] = key; in put() 432 alternatingKeysAndValues[2 * size + 1] = value; in put() 504 other.alternatingKeysAndValues, in combine() 506 this.alternatingKeysAndValues, in combine() [all …]
|
D | ImmutableBiMap.java | 453 alternatingKeysAndValues = Arrays.copyOf(alternatingKeysAndValues, 2 * size); in buildOrThrow() 455 sortEntries(alternatingKeysAndValues, size, valueComparator); in buildOrThrow() 458 return new RegularImmutableBiMap<K, V>(alternatingKeysAndValues, size); in buildOrThrow()
|
/external/guava/android/guava-tests/test/com/google/common/collect/ |
D | CompactLinkedHashMapTest.java | 129 private void testHasMapEntriesInOrder(Map<?, ?> map, Object... alternatingKeysAndValues) { in testHasMapEntriesInOrder() argument 133 assertEquals(2 * entries.size(), alternatingKeysAndValues.length); in testHasMapEntriesInOrder() 134 assertEquals(2 * keys.size(), alternatingKeysAndValues.length); in testHasMapEntriesInOrder() 135 assertEquals(2 * values.size(), alternatingKeysAndValues.length); in testHasMapEntriesInOrder() 137 Object expectedKey = alternatingKeysAndValues[2 * i]; in testHasMapEntriesInOrder() 138 Object expectedValue = alternatingKeysAndValues[2 * i + 1]; in testHasMapEntriesInOrder()
|
D | ImmutableBiMapTest.java | 212 Object[] builderArray = builder.alternatingKeysAndValues; in testBuilderExactlySizedReusesArray() 216 Object[] builderArrayAfterPuts = builder.alternatingKeysAndValues; in testBuilderExactlySizedReusesArray() 219 Object[] mapInternalArray = map.alternatingKeysAndValues; in testBuilderExactlySizedReusesArray() 754 private static <K, V> void assertMapEquals(Map<K, V> map, Object... alternatingKeysAndValues) { in assertMapEquals() argument 756 for (int i = 0; i < alternatingKeysAndValues.length; i += 2) { in assertMapEquals() 757 expected.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i + 1]); in assertMapEquals()
|
D | ImmutableMapTest.java | 349 Object[] builderArray = builder.alternatingKeysAndValues; in testBuilderExactlySizedReusesArray() 353 Object[] builderArrayAfterPuts = builder.alternatingKeysAndValues; in testBuilderExactlySizedReusesArray() 356 Object[] mapInternalArray = map.alternatingKeysAndValues; in testBuilderExactlySizedReusesArray() 1014 private static <K, V> void assertMapEquals(Map<K, V> map, Object... alternatingKeysAndValues) { in assertMapEquals() argument 1016 for (int i = 0; i < alternatingKeysAndValues.length; i += 2) { in assertMapEquals() 1017 expected.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i + 1]); in assertMapEquals()
|
D | ImmutableListMultimapTest.java | 548 Multimap<K, V> multimap, Object... alternatingKeysAndValues) { in assertMultimapEquals() argument 549 assertEquals(multimap.size(), alternatingKeysAndValues.length / 2); in assertMultimapEquals() 552 assertEquals(alternatingKeysAndValues[i++], entry.getKey()); in assertMultimapEquals() 553 assertEquals(alternatingKeysAndValues[i++], entry.getValue()); in assertMultimapEquals()
|
D | ImmutableSetMultimapTest.java | 542 Multimap<K, V> multimap, Object... alternatingKeysAndValues) { in assertMultimapEquals() argument 543 assertEquals(multimap.size(), alternatingKeysAndValues.length / 2); in assertMultimapEquals() 546 assertEquals(alternatingKeysAndValues[i++], entry.getKey()); in assertMultimapEquals() 547 assertEquals(alternatingKeysAndValues[i++], entry.getValue()); in assertMultimapEquals()
|
D | ImmutableSortedMapTest.java | 878 private static <K, V> void assertMapEquals(Map<K, V> map, Object... alternatingKeysAndValues) { in assertMapEquals() argument 880 for (int i = 0; i < alternatingKeysAndValues.length; i += 2) { in assertMapEquals() 881 expected.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i + 1]); in assertMapEquals()
|
/external/guava/guava-tests/test/com/google/common/collect/ |
D | CompactLinkedHashMapTest.java | 152 private void testHasMapEntriesInOrder(Map<?, ?> map, Object... alternatingKeysAndValues) { in testHasMapEntriesInOrder() argument 156 assertEquals(2 * entries.size(), alternatingKeysAndValues.length); in testHasMapEntriesInOrder() 157 assertEquals(2 * keys.size(), alternatingKeysAndValues.length); in testHasMapEntriesInOrder() 158 assertEquals(2 * values.size(), alternatingKeysAndValues.length); in testHasMapEntriesInOrder() 160 Object expectedKey = alternatingKeysAndValues[2 * i]; in testHasMapEntriesInOrder() 161 Object expectedValue = alternatingKeysAndValues[2 * i + 1]; in testHasMapEntriesInOrder()
|
D | ImmutableListMultimapTest.java | 578 Multimap<K, V> multimap, Object... alternatingKeysAndValues) { in assertMultimapEquals() argument 579 assertEquals(multimap.size(), alternatingKeysAndValues.length / 2); in assertMultimapEquals() 582 assertEquals(alternatingKeysAndValues[i++], entry.getKey()); in assertMultimapEquals() 583 assertEquals(alternatingKeysAndValues[i++], entry.getValue()); in assertMultimapEquals()
|
D | ImmutableSetMultimapTest.java | 574 Multimap<K, V> multimap, Object... alternatingKeysAndValues) { in assertMultimapEquals() argument 575 assertEquals(multimap.size(), alternatingKeysAndValues.length / 2); in assertMultimapEquals() 578 assertEquals(alternatingKeysAndValues[i++], entry.getKey()); in assertMultimapEquals() 579 assertEquals(alternatingKeysAndValues[i++], entry.getValue()); in assertMultimapEquals()
|
D | ImmutableBiMapTest.java | 786 private static <K, V> void assertMapEquals(Map<K, V> map, Object... alternatingKeysAndValues) { in assertMapEquals() argument 788 for (int i = 0; i < alternatingKeysAndValues.length; i += 2) { in assertMapEquals() 789 expected.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i + 1]); in assertMapEquals()
|
D | ImmutableSortedMapTest.java | 907 private static <K, V> void assertMapEquals(Map<K, V> map, Object... alternatingKeysAndValues) { in assertMapEquals() argument 909 for (int i = 0; i < alternatingKeysAndValues.length; i += 2) { in assertMapEquals() 910 expected.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i + 1]); in assertMapEquals()
|
D | ImmutableMapTest.java | 1077 private static <K, V> void assertMapEquals(Map<K, V> map, Object... alternatingKeysAndValues) { in assertMapEquals() argument 1079 for (int i = 0; i < alternatingKeysAndValues.length; i += 2) { in assertMapEquals() 1080 expected.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i + 1]); in assertMapEquals()
|