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

com.exasol.adapter.document.documentfetcher.files.csv.NullSinkFactory Maven / Gradle / Ivy

There is a newer version: 8.1.3
Show newest version
package com.exasol.adapter.document.documentfetcher.files.csv;

import io.deephaven.csv.sinks.*;
import io.deephaven.csv.util.MutableObject;

/**
 * This is a "null" {@link SinkFactory} for the Deephaven-CSV library. It's purpose is to save memory while detecting
 * data types without collecting column data.
 */
public class NullSinkFactory implements SinkFactory {

    @Override
    public Sink forByte(final int colNum, final MutableObject> source) {
        return new NullSink<>();
    }

    @Override
    public Byte reservedByte() {
        return null;
    }

    @Override
    public Sink forShort(final int colNum, final MutableObject> source) {
        return new NullSink<>();
    }

    @Override
    public Short reservedShort() {
        return null;
    }

    @Override
    public Sink forInt(final int colNum, final MutableObject> source) {
        return new NullSink<>();
    }

    @Override
    public Integer reservedInt() {
        return null;
    }

    @Override
    public Sink forLong(final int colNum, final MutableObject> source) {
        return new NullSink<>();
    }

    @Override
    public Long reservedLong() {
        return null;
    }

    @Override
    public Sink forFloat(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public Float reservedFloat() {
        return null;
    }

    @Override
    public Sink forDouble(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public Double reservedDouble() {
        return null;
    }

    @Override
    public Sink forBooleanAsByte(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public Sink forChar(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public Character reservedChar() {
        return null;
    }

    @Override
    public Sink forString(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public String reservedString() {
        return null;
    }

    @Override
    public Sink forDateTimeAsLong(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public Long reservedDateTimeAsLong() {
        return null;
    }

    @Override
    public Sink forTimestampAsLong(final int colNum) {
        return new NullSink<>();
    }

    @Override
    public Long reservedTimestampAsLong() {
        return null;
    }

    private static class NullSink implements Sink {
        @Override
        public void write(final T src, final boolean[] isNull, final long destBegin, final long destEnd,
                final boolean appending) {
            // empty on purpose
        }

        @Override
        public Object getUnderlying() {
            return null;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy