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