@Benchmark public void kolobokeRemove() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(this.longLongKoloboke); for (int i = 0; i < KEY_COUNT; i++) { newMap.remove(this.kolobokeLongKeysForMap[i]); } if (newMap.size() != 0) { throw new AssertionError("size is " + newMap.size()); } } }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newMutableMap() newMutableMap()}. * * @return a new empty mutable map */ @Nonnull public static HashLongLongMap newMutableMap() { return getDefaultFactory().newMutableMap(); }
/** * Constructs a new empty updatable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newUpdatableMap() newUpdatableMap()}. * * @return a new empty updatable map */ @Nonnull public static HashLongLongMap newUpdatableMap() { return getDefaultFactory().newUpdatableMap(); }
/** * Constructs a new empty mutable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newMutableMap(int) newMutableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @return a new empty mutable map of the given expected size */ @Nonnull public static HashLongLongMap newMutableMap(int expectedSize) { return getDefaultFactory().newMutableMap(expectedSize); }
@Benchmark public void kolobokePut() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(MAP_SIZE); for (int i = 0; i < KEY_COUNT; i++) { newMap.put(this.kolobokeLongKeysForMap[i], 4); } if (newMap.size() != KEY_COUNT) { throw new AssertionError("size is " + newMap.size()); } } }
/** * Constructs a new empty updatable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newUpdatableMap(int) newUpdatableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @return a new empty updatable map of the given expected size */ @Nonnull public static HashLongLongMap newUpdatableMap(int expectedSize) { return getDefaultFactory().newUpdatableMap(expectedSize); }
@Benchmark public void kolobokeRemove() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(this.longLongKoloboke); for (int i = 0; i < KEY_COUNT; i++) { newMap.remove(this.kolobokeLongKeysForMap[i]); } if (newMap.size() != 0) { throw new AssertionError("size is " + newMap.size()); } } }
/** * Constructs a new mutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newMutableMapOf(long, long * ) newMutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @return a new mutable map of the single specified mapping */ @Nonnull public static HashLongLongMap newMutableMapOf( long k1, long v1) { return getDefaultFactory().newMutableMapOf(k1, v1); }
@Benchmark public void kolobokePut() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(MAP_SIZE); for (int i = 0; i < KEY_COUNT; i++) { newMap.put(this.kolobokeLongKeysForMap[i], 4); } if (newMap.size() != KEY_COUNT) { throw new AssertionError("size is " + newMap.size()); } } }
/** * Constructs a new updatable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newUpdatableMapOf(long, long * ) newUpdatableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @return a new updatable map of the single specified mapping */ @Nonnull public static HashLongLongMap newUpdatableMapOf( long k1, long v1) { return getDefaultFactory().newUpdatableMapOf(k1, v1); }
@Setup public void setUp() { this.longLongKoloboke = HashLongLongMaps.newMutableMap(MAP_SIZE); this.longLongGsc = new LongLongHashMap(MAP_SIZE); Random random = new Random(0x123456789ABCDL); int number = 23; int lower = Integer.MIN_VALUE; int upper = Integer.MAX_VALUE; long[] randomNumbersForMap = this.getRandomKeys(random).toArray(); this.gscLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getGSCArray(number, lower, upper, random); this.kolobokeLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getKolobokeArray(number, lower, upper, random); for (int i = 0; i < KEY_COUNT; i++) { this.longLongKoloboke.put(this.kolobokeLongKeysForMap[i], 5); this.longLongGsc.put(this.gscLongKeysForMap[i], 5); } this.shuffle(this.gscLongKeysForMap, random); this.shuffle(this.kolobokeLongKeysForMap, random); }
/** * Constructs a new immutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newImmutableMapOf(long, long * ) newImmutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @return a new immutable map of the single specified mapping */ @Nonnull public static HashLongLongMap newImmutableMapOf( long k1, long v1) { return getDefaultFactory().newImmutableMapOf(k1, v1); }
@Setup public void setUp() { this.longLongKoloboke = HashLongLongMaps.newMutableMap(MAP_SIZE); this.longLongGsc = new LongLongHashMap(MAP_SIZE); Random random = new Random(0x123456789ABCDL); int number = 23; int lower = Integer.MIN_VALUE; int upper = Integer.MAX_VALUE; long[] randomNumbersForMap = this.getRandomKeys(random).toArray(); this.gscLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getGSCArray(number, lower, upper, random); this.kolobokeLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getKolobokeArray(number, lower, upper, random); for (int i = 0; i < KEY_COUNT; i++) { this.longLongKoloboke.put(this.kolobokeLongKeysForMap[i], 5); this.longLongGsc.put(this.gscLongKeysForMap[i], 5); } this.shuffle(this.gscLongKeysForMap, random); this.shuffle(this.kolobokeLongKeysForMap, random); }
/** * Constructs a new mutable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newMutableMapOf(long, long, * long, long) newMutableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @return a new mutable map of the two specified mappings */ @Nonnull public static HashLongLongMap newMutableMapOf( long k1, long v1, long k2, long v2) { return getDefaultFactory().newMutableMapOf(k1, v1, k2, v2); }
/** * Constructs a new immutable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newImmutableMap( * Map) newImmutableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @return a new immutable map with the same mappings as the specified {@code map} */ @Nonnull public static HashLongLongMap newImmutableMap( @Nonnull Map<Long, Long> map) { return getDefaultFactory().newImmutableMap(map); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the {@code map2} have priority over mappings from the {@code map1} with * the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newMutableMap(Map, * Map, int) newMutableMap(map1, map2, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param expectedSize the expected size of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static HashLongLongMap newMutableMap( @Nonnull Map<Long, Long> map1, @Nonnull Map<Long, Long> map2, int expectedSize) { return getDefaultFactory().newMutableMap(map1, map2, expectedSize); }
/** * Constructs a new immutable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newImmutableMapOf(long, long, * long, long) newImmutableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @return a new immutable map of the two specified mappings */ @Nonnull public static HashLongLongMap newImmutableMapOf( long k1, long v1, long k2, long v2) { return getDefaultFactory().newImmutableMapOf(k1, v1, k2, v2); }
/** * Constructs a new immutable map which merge the mappings of the specified maps. On conflict, * mappings from the {@code map2} have priority over mappings from the {@code map1} with * the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newImmutableMap(Map, * Map, int) newImmutableMap(map1, map2, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param expectedSize the expected size of the returned map * @return a new immutable map which merge the mappings of the specified maps */ @Nonnull public static HashLongLongMap newImmutableMap( @Nonnull Map<Long, Long> map1, @Nonnull Map<Long, Long> map2, int expectedSize) { return getDefaultFactory().newImmutableMap(map1, map2, expectedSize); }
/** * Constructs a new mutable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newMutableMap( * Map) newMutableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @return a new mutable map with the same mappings as the specified {@code map} */ @Nonnull public static HashLongLongMap newMutableMap( @Nonnull Map<Long, Long> map) { return getDefaultFactory().newMutableMap(map); }
/** * Constructs a new updatable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongLongMapFactory#newUpdatableMap( * Map) newUpdatableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @return a new updatable map with the same mappings as the specified {@code map} */ @Nonnull public static HashLongLongMap newUpdatableMap( @Nonnull Map<Long, Long> map) { return getDefaultFactory().newUpdatableMap(map); }