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