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