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