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