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