All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.engine.table.impl.select.setinclusion.SetInclusionKernel Maven / Gradle / Ivy

There is a newer version: 0.37.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.engine.table.impl.select.setinclusion;

import io.deephaven.chunk.Chunk;
import io.deephaven.chunk.ChunkType;
import io.deephaven.chunk.WritableBooleanChunk;
import io.deephaven.chunk.attributes.Values;

import java.util.Collection;

public interface SetInclusionKernel {
    void matchValues(Chunk values, WritableBooleanChunk matches);

    static SetInclusionKernel makeKernel(ChunkType type, Collection values, boolean inclusion) {
        switch (type) {
            case Object:
                return new ObjectSetInclusionKernel(values, inclusion);
            case Char:
                return new CharSetInclusionKernel(values, inclusion);
            case Byte:
                return new ByteSetInclusionKernel(values, inclusion);
            case Short:
                return new ShortSetInclusionKernel(values, inclusion);
            case Int:
                return new IntSetInclusionKernel(values, inclusion);
            case Long:
                return new LongSetInclusionKernel(values, inclusion);
            case Double:
                return new DoubleSetInclusionKernel(values, inclusion);
            case Float:
                return new FloatSetInclusionKernel(values, inclusion);
            default:
                throw new UnsupportedOperationException();
        }
    }
}