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