io.deephaven.engine.table.impl.join.dupexpand.LongDupExpandKernel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-table Show documentation
Show all versions of deephaven-engine-table Show documentation
Engine Table: Implementation and closely-coupled utilities
/**
* Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
*/
/*
* ---------------------------------------------------------------------------------------------------------------------
* AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY - for any changes edit CharDupExpandKernel and regenerate
* ---------------------------------------------------------------------------------------------------------------------
*/
package io.deephaven.engine.table.impl.join.dupexpand;
import io.deephaven.chunk.*;
import io.deephaven.chunk.attributes.Any;
import io.deephaven.chunk.attributes.ChunkLengths;
public class LongDupExpandKernel implements DupExpandKernel {
public static final LongDupExpandKernel INSTANCE = new LongDupExpandKernel();
private LongDupExpandKernel() {} // use through the instance
@Override
public void expandDuplicates(int expandedSize, WritableChunk extends Any> chunkToExpand, IntChunk keyRunLengths) {
expandDuplicates(expandedSize, chunkToExpand.asWritableLongChunk(), keyRunLengths);
}
public static void expandDuplicates(int expandedSize, WritableLongChunk extends Any> chunkToExpand, IntChunk keyRunLengths) {
if (expandedSize == 0) {
return;
}
int wpos = expandedSize;
int rpos = chunkToExpand.size() - 1;
chunkToExpand.setSize(expandedSize);
for (; rpos >= 0; --rpos) {
final int len = keyRunLengths.get(rpos);
chunkToExpand.fillWithValue(wpos - len, len, chunkToExpand.get(rpos));
wpos -= len;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy