![JAR search and dependency download from the Maven repository](/logo.png)
io.github.vmzakharov.ecdataframe.dsl.value.VectorValue 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.dsl.value;
import io.github.vmzakharov.ecdataframe.dsl.UnaryOp;
import org.eclipse.collections.api.list.ListIterable;
import org.eclipse.collections.impl.factory.Lists;
public record VectorValue(ListIterable elements)
implements Value
{
public static final VectorValue EMPTY = new VectorValue(Lists.immutable.empty());
@Override
public String asStringLiteral()
{
return this.elements.makeString(Value::asStringLiteral, "(", ", ", ")");
}
@Override
public ValueType getType()
{
return ValueType.VECTOR;
}
public ListIterable getElements()
{
return this.elements;
}
public int size()
{
return this.elements.size();
}
public Value get(int index)
{
return this.elements.get(index);
}
@Override
public Value apply(UnaryOp operation)
{
return operation.applyVector(this.elements);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy