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