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