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