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