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