io.github.vmzakharov.ecdataframe.dataframe.DfObjectColumnAbstract Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dataframe-ec Show documentation
Show all versions of dataframe-ec Show documentation
A tabular data structure based on the Eclipse Collections framework
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;
}
}