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