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