io.deephaven.engine.table.impl.util.copy.ObjectCopyKernel Maven / Gradle / Ivy
Show all versions of deephaven-engine-table Show documentation
/**
* Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
*/
package io.deephaven.engine.table.impl.util.copy;
import io.deephaven.chunk.*;
import io.deephaven.chunk.attributes.Any;
public class ObjectCopyKernel implements CopyKernel {
public static final ObjectCopyKernel INSTANCE = new ObjectCopyKernel();
private ObjectCopyKernel() {} // use through the instance
/**
* Copy values from baseInput / overInput into output.
*
* Pseudo-implementation: output[i] = useOverInput.forBit(i) ? overInput[i] : baseInput[i];
*
* Note that useOverInput should cover the same data range as baseInput such that
* {@code useOverInput.length == (overInput.length + 63) / 64} is true.
*
* @param output the output chunk
* @param baseInput the input array to use when bit in useOverInput is zero (array)
* @param overInput the input array to use when bit in useOverInput is one (array)
* @param useOverInput the bitset array to indicate whether to use baseInput or overInput for each element
* @param srcOffset the offset in baseInput/overInput
* @param dstOffset the offset in output
* @param length the number of elements to copy
*/
public static void conditionalCopy(
WritableObjectChunk