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

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

import io.deephaven.engine.rowset.RowSequence;
import io.deephaven.engine.table.impl.AbstractColumnSource;
import io.deephaven.engine.table.impl.ImmutableColumnSourceGetDefaults;

/**
 * ColumnSource implementation for columns of a single unique value.
 */
public class SingleValueObjectColumnSource extends AbstractColumnSource implements ImmutableColumnSourceGetDefaults.ForObject {

    private final DATA_TYPE value;

    public SingleValueObjectColumnSource(DATA_TYPE value) {
        //noinspection unchecked
        super((Class)value.getClass());
        this.value = value;
    }

    @Override
    public DATA_TYPE get(long rowKey) {
        if(rowKey == RowSequence.NULL_ROW_KEY) {
            return null;
        }
        return value;
    }

    @Override
    public void startTrackingPrevValues() {
        // Do nothing.
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy