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