io.github.vmzakharov.ecdataframe.dataframe.DfObjectColumn Maven / Gradle / Ivy
package io.github.vmzakharov.ecdataframe.dataframe;
import io.github.vmzakharov.ecdataframe.dsl.value.Value;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.list.ImmutableList;
public interface DfObjectColumn
extends DfColumn
{
ImmutableList toList();
T getTypedObject(int rowIndex);
Value objectToValue(T anObject);
@Override
default Object getObject(int rowIndex)
{
return this.getTypedObject(rowIndex);
}
default IV injectIntoBreakOnNulls(
IV injectedValue,
Function2 function
)
{
IV result = injectedValue;
for (int i = 0; i < this.getSize(); i++)
{
T current = this.getTypedObject(i);
if (current == null)
{
return null;
}
result = function.apply(result, current);
if (result == null)
{
return null;
}
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy