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