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