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