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