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