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

io.github.vmzakharov.ecdataframe.dataframe.DfObjectColumnAbstract Maven / Gradle / Ivy

The newest version!
package io.github.vmzakharov.ecdataframe.dataframe;

import org.eclipse.collections.api.list.ListIterable;

abstract public class DfObjectColumnAbstract
extends DfColumnAbstract
implements DfObjectColumn
{
    public DfObjectColumnAbstract(DataFrame newDataFrame, String newName)
    {
        super(newDataFrame, newName);
    }

    @Override
    public boolean isNull(int rowIndex)
    {
        return this.getObject(rowIndex) == null;
    }

    abstract protected void addAllItems(ListIterable items);

    @Override
    public DfColumn mergeWithInto(DfColumn other, DataFrame target)
    {
        DfObjectColumnAbstract mergedCol = (DfObjectColumnAbstract) this.validateAndCreateTargetColumn(other, target);

        mergedCol.addAllItems(this.toList());
        mergedCol.addAllItems(((DfObjectColumnAbstract) other).toList());
        return mergedCol;
    }

    @Override
    public DfColumn copyTo(DataFrame target)
    {
        DfObjectColumnAbstract targetCol = (DfObjectColumnAbstract) this.copyColumnSchemaAndEnsureCapacity(target);

        targetCol.addAllItems(this.toList());
        return targetCol;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy