io.deephaven.engine.table.impl.by.alternatingcolumnsource.LongAlternatingColumnSourceUnorderedMergeKernel 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 CharAlternatingColumnSourceUnorderedMergeKernel and regenerate
* ---------------------------------------------------------------------------------------------------------------------
*/
package io.deephaven.engine.table.impl.by.alternatingcolumnsource;
import io.deephaven.chunk.*;
import io.deephaven.chunk.attributes.Values;
import io.deephaven.engine.rowset.chunkattributes.RowKeys;
import static io.deephaven.engine.table.impl.by.alternatingcolumnsource.AlternatingColumnSource.ALTERNATE_SWITCH_MASK;
public class LongAlternatingColumnSourceUnorderedMergeKernel implements AlternatingColumnSourceUnorderedMergeKernel {
public static LongAlternatingColumnSourceUnorderedMergeKernel INSTANCE = new LongAlternatingColumnSourceUnorderedMergeKernel();
// static use only
private LongAlternatingColumnSourceUnorderedMergeKernel() {}
@Override
public void mergeContext(WritableChunk super Values> dest, LongChunk extends RowKeys> outerKeys, Chunk super Values> src, int alternatePosition) {
final WritableLongChunk super Values> destAsLong = dest.asWritableLongChunk();
final LongChunk super Values> srcAsLong = src.asLongChunk();
// now merge them together
int mainPosition = 0;
destAsLong.setSize(outerKeys.size());
for (int ii = 0; ii < outerKeys.size(); ++ii) {
final long outerKey = outerKeys.get(ii);
if ((outerKey & ALTERNATE_SWITCH_MASK) == 0) {
destAsLong.set(ii, srcAsLong.get(mainPosition++));
} else {
destAsLong.set(ii, srcAsLong.get(alternatePosition++));
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy