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