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