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