package at.yawk.numaec;
import org.eclipse.collections.api.map.primitive.IntLongMap;
public final class MutableIntLongBTreeMapFactory implements MutableIntLongBufferMapFactory {
private final LargeByteBufferAllocator allocator;
private final BTreeConfig config;
private MutableIntLongBTreeMapFactory(LargeByteBufferAllocator allocator, BTreeConfig config) {
this.allocator = allocator;
this.config = config;
}
public static MutableIntLongBufferMapFactory withAllocator(LargeByteBufferAllocator allocator) {
return withAllocatorAndConfig(allocator, BTreeConfig.builder().build());
}
public static MutableIntLongBufferMapFactory withAllocatorAndConfig(
LargeByteBufferAllocator allocator, BTreeConfig config
) {
return new MutableIntLongBTreeMapFactory(allocator, config);
}
@Override
public MutableIntLongBufferMap empty() {
return new IntLongBTreeMap.Mutable(allocator, config);
}
@Override
public MutableIntLongBufferMap ofInitialCapacity(int capacity) {
return empty();
}
@Override
public MutableIntLongBufferMap ofAll(IntLongMap map) {
MutableIntLongBufferMap n = ofInitialCapacity(map.size());
n.putAll(map);
return n;
}
}