package at.yawk.numaec;
import org.eclipse.collections.api.factory.map.primitive.MutableLongFloatMapFactory;
import org.eclipse.collections.api.map.primitive.LongFloatMap;
public final class MutableLongFloatLinearHashMapFactory implements MutableLongFloatBufferMapFactory {
private final LargeByteBufferAllocator allocator;
private final LinearHashMapConfig config;
private MutableLongFloatLinearHashMapFactory(LargeByteBufferAllocator allocator, LinearHashMapConfig config) {
this.allocator = allocator;
this.config = config;
}
public static MutableLongFloatMapFactory withAllocator(LargeByteBufferAllocator allocator) {
return withAllocatorAndConfig(allocator, LinearHashMapConfig.builder().build());
}
public static MutableLongFloatMapFactory withAllocatorAndConfig(
LargeByteBufferAllocator allocator, LinearHashMapConfig config
) {
return new MutableLongFloatLinearHashMapFactory(allocator, config);
}
@Override
public MutableLongFloatBufferMap empty() {
return new LongFloatLinearHashMap.Mutable(allocator, config);
}
@Override
public MutableLongFloatBufferMap ofInitialCapacity(int capacity) {
LongFloatLinearHashMap.Mutable map = new LongFloatLinearHashMap.Mutable(allocator, config);
map.ensureCapacity(capacity);
return map;
}
@Override
public MutableLongFloatBufferMap ofAll(LongFloatMap map) {
MutableLongFloatBufferMap n = ofInitialCapacity(map.size());
n.putAll(map);
return n;
}
}