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