com.xxdb.data.AbstractVector 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 com.xxdb.io.ExtendedDataOutput;
public abstract class AbstractVector extends AbstractEntity implements Vector{
private DATA_FORM df_;
protected static final int BUF_SIZE = 4096;
protected byte[] buf = new byte[BUF_SIZE];
protected abstract void writeVectorToOutputStream(ExtendedDataOutput out) throws IOException;
public AbstractVector(DATA_FORM df){
df_ = df;
}
@Override
public DATA_FORM getDataForm() {
return df_;
}
@Override
public int columns() {
return 1;
}
public String getString(){
StringBuilder sb = new StringBuilder("[");
int size = Math.min(DISPLAY_ROWS, rows());
if(size > 0)
sb.append(get(0).getString());
for(int i=1; i