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