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

com.xxdb.data.AbstractScalar 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 AbstractScalar extends AbstractEntity implements Scalar{
	
	protected abstract void writeScalarToOutputStream(ExtendedDataOutput out) throws IOException;
	
	@Override
	public DATA_FORM getDataForm() {
		return Entity.DATA_FORM.DF_SCALAR;
	}
	
	@Override
	public int rows() {
		return 1;
	}
	@Override
	public int columns() {
		return 1;
	}
	
	public void write(ExtendedDataOutput out) throws IOException{
		int flag = (DATA_FORM.DF_SCALAR.ordinal() << 8) + getDataType().ordinal();
		out.writeShort(flag);
		writeScalarToOutputStream(out);
	}
	
	@Override
	public String toString(){
		return getString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy