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

io.deephaven.engine.table.impl.sources.regioned.ColumnRegionReferencing 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.sources.regioned;

import io.deephaven.chunk.attributes.Any;
import io.deephaven.chunk.Chunk;
import io.deephaven.chunk.ChunkType;
import io.deephaven.chunk.WritableChunk;
import io.deephaven.engine.rowset.RowSequence;
import io.deephaven.util.annotations.FinalDefault;
import org.jetbrains.annotations.NotNull;

public interface ColumnRegionReferencing>
        extends ColumnRegion {

    @NotNull
    REFERENCED_COLUMN_REGION getReferencedRegion();

    @Override
    @FinalDefault
    default ChunkType getChunkType() {
        throw new UnsupportedOperationException(getClass() + " does not know its chunk type");
    }

    interface Converter {

        /**
         * Converts all the native source values represented by {@code rowSequence} from a single region into
         * the {@code destination} chunk by appending.
         */
        void convertRegion(
                @NotNull WritableChunk destination,
                @NotNull Chunk source,
                @NotNull RowSequence rowSequence);
    }

    class Null>
            extends ColumnRegion.Null
            implements ColumnRegionReferencing {

        private final REFERENCED_COLUMN_REGION nullReferencedColumnRegion;

        public Null(REFERENCED_COLUMN_REGION nullReferencedColumnRegion) {
            super((nullReferencedColumnRegion.mask()));
            this.nullReferencedColumnRegion = nullReferencedColumnRegion;
        }

        @Override
        @NotNull
        public REFERENCED_COLUMN_REGION getReferencedRegion() {
            return nullReferencedColumnRegion;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy