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