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