All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xxdb.data.AbstractVector Maven / Gradle / Ivy

Go to download

The messaging and data conversion protocol between Java and DolphinDB server

There is a newer version: 1.0.27
Show newest version
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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy