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