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