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