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