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