com.xxdb.data.BasicFloatVector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-java Show documentation
Show all versions of api-java Show documentation
The messaging and data conversion protocol between Java and DolphinDB server
package com.xxdb.data;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.List;
import com.xxdb.io.ExtendedDataInput;
import com.xxdb.io.ExtendedDataOutput;
/**
*
* Corresponds to DolphinDB float vector
*
*/
public class BasicFloatVector extends AbstractVector{
private float[] values;
public BasicFloatVector(int size){
this(DATA_FORM.DF_VECTOR, size);
}
public BasicFloatVector(List list){
super(DATA_FORM.DF_VECTOR);
if (list != null) {
values = new float[list.size()];
for (int i=0; i getElementClass(){
return BasicFloat.class;
}
protected void writeVectorToOutputStream(ExtendedDataOutput out) throws IOException{
out.writeFloatArray(values);
}
}